Add a test that large offsets on GEPs on 32 bits targets are handled correctly.
authorBenjamin Kramer <benny.kra@googlemail.com>
Sat, 28 Sep 2013 21:27:49 +0000 (21:27 +0000)
committerBenjamin Kramer <benny.kra@googlemail.com>
Sat, 28 Sep 2013 21:27:49 +0000 (21:27 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@191628 91177308-0d34-0410-b5e6-96231b3b80d8

test/Transforms/InstSimplify/compare.ll

index 83705aac8530a735019033cf41c7b057b38a114c..abb38695e71060315bf594c79f58b9f1e8a963a8 100644 (file)
@@ -729,3 +729,13 @@ define i1 @non_inbounds_gep_compare(i64* %a) {
   ret i1 %cmp
 ; CHECK-NEXT: ret i1 true
 }
+
+define i1 @non_inbounds_gep_compare2(i64* %a) {
+; CHECK-LABEL: @non_inbounds_gep_compare2(
+; Equality compares with non-inbounds GEPs can be folded.
+  %x = getelementptr i64* %a, i64 4294967297
+  %y = getelementptr i64* %a, i64 1
+  %cmp = icmp eq i64* %y, %y
+  ret i1 %cmp
+; CHECK-NEXT: ret i1 true
+}