aboutsummaryrefslogtreecommitdiffstats
path: root/test/Transforms/GlobalOpt/globalsra-partial.llx
blob: 9b3788e463a34339066dd4394e45268c3797396a (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-as < %s | 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
}