aboutsummaryrefslogtreecommitdiffstats
path: root/test/Analysis/BasicAA/2004-01-29-InvariantMemory.llx
blob: cfc4c480cf43200bee64c287086848fb455ae940 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
; RUN: llvm-as < %s | opt -load-vn -gcse -instcombine | llvm-dis | not grep load

%X = constant [2 x int] [int 4, int 5]

int %test(int* %Y, long %idx) {
        %P = getelementptr [2 x int]* %X, long 0, long %idx
	%A = load int* %P      ; Load from invariant memory
	store int 4, int* %Y   ; Store could not be to %X
	%B = load int* %P
	%C = sub int %A, %B
	ret int %C
}