llvm-6502/test/Transforms/InstCombine/getelementptr-seteq.ll
Dan Gohman d6aa02de10 Teach instcombine to respect and preserve inbounds. Add inbounds
to a few tests where it is required for the expected transformation.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77290 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-28 01:40:03 +00:00

14 lines
371 B
LLVM

; 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
}