diff options
Diffstat (limited to 'test/Transforms/InstCombine/GEPIdxCanon.ll')
-rw-r--r-- | test/Transforms/InstCombine/GEPIdxCanon.ll | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/test/Transforms/InstCombine/GEPIdxCanon.ll b/test/Transforms/InstCombine/GEPIdxCanon.ll new file mode 100644 index 000000000000..f2e5e6745b48 --- /dev/null +++ b/test/Transforms/InstCombine/GEPIdxCanon.ll @@ -0,0 +1,10 @@ +; RUN: llvm-as < %s | opt -instcombine -gvn -instcombine | \ +; RUN: llvm-dis | not grep getelementptr + +define i1 @test(i32* %A) { + %B = getelementptr i32* %A, i32 1 ; <i32*> [#uses=1] + %C = getelementptr i32* %A, i64 1 ; <i32*> [#uses=1] + %V = icmp eq i32* %B, %C ; <i1> [#uses=1] + ret i1 %V +} + |