summaryrefslogtreecommitdiffstats
path: root/test/Transforms/InstCombine/getelementptr-seteq.ll
blob: 2cd6f77b89fa6493144b78b2a543cacef0297223 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
; Test folding of constantexpr geps into normal geps.
; RUN: llvm-as < %s | opt -instcombine | llvm-dis | grep {icmp eq i64 %X, -1}
; PR2235

%S = type { i32, [ 100 x i32] }

define i1 @test(i64 %X, %S* %P) {
        %A = getelementptr inbounds %S* %P, i32 0, i32 1, i64 %X
        %B = getelementptr inbounds %S* %P, i32 0, i32 0
	%C = icmp eq i32* %A, %B
	ret i1 %C
}