aboutsummaryrefslogtreecommitdiff
path: root/test/Transforms/GlobalOpt/globalsra-partial.llx
blob: e060565b114e891ba96257bb85ed892a8244c33d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
; In this case, the global can only be broken up by one level.

; RUN: llvm-upgrade < %s | llvm-as | opt -globalopt | llvm-dis | not grep 12345

%G = internal global { int, [4 x float] } zeroinitializer

void %onlystore() {
	store int 12345, int* getelementptr ({ int, [4 x float] }* %G, int 0, uint 0)
	ret void
}

void %storeinit(int %i) {
	%Ptr = getelementptr { int, [4 x float] }* %G, int 0, uint 1, int %i
	store float 1.0, float* %Ptr
	ret void
}

float %readval(int %i) {
	%Ptr = getelementptr { int, [4 x float] }* %G, int 0, uint 1, int %i
	%V = load float* %Ptr
	ret float %V
}