aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorBenjamin Kramer <benny.kra@googlemail.com>2012-02-20 19:00:28 +0000
committerBenjamin Kramer <benny.kra@googlemail.com>2012-02-20 19:00:28 +0000
commit117314009ea4b3fda57579bba0f9e61159eb0966 (patch)
tree3435253bbac510cbb05249e2a99885d707435044 /test
parent6ad48f413743366c91b088a8e39d7f882200429d (diff)
downloadexternal_llvm-117314009ea4b3fda57579bba0f9e61159eb0966.zip
external_llvm-117314009ea4b3fda57579bba0f9e61159eb0966.tar.gz
external_llvm-117314009ea4b3fda57579bba0f9e61159eb0966.tar.bz2
Test case for r150978.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150979 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test')
-rw-r--r--test/Transforms/InstCombine/icmp.ll13
1 files changed, 13 insertions, 0 deletions
diff --git a/test/Transforms/InstCombine/icmp.ll b/test/Transforms/InstCombine/icmp.ll
index 09152f0..8c48719 100644
--- a/test/Transforms/InstCombine/icmp.ll
+++ b/test/Transforms/InstCombine/icmp.ll
@@ -615,3 +615,16 @@ define i1 @test60(i8* %foo, i64 %i, i64 %j) {
; CHECK-NEXT: icmp slt i64 %gep1.idx, %j
; CHECK-NEXT: ret i1
}
+
+define i1 @test61(i8* %foo, i64 %i, i64 %j) {
+ %bit = bitcast i8* %foo to i32*
+ %gep1 = getelementptr i32* %bit, i64 %i
+ %gep2 = getelementptr i8* %foo, i64 %j
+ %cast1 = bitcast i32* %gep1 to i8*
+ %cmp = icmp ult i8* %cast1, %gep2
+ ret i1 %cmp
+; Don't transform non-inbounds GEPs.
+; CHECK: @test61
+; CHECK: icmp ult i8* %cast1, %gep2
+; CHECK-NEXT: ret i1
+}