From fc2599f186c1f409a21b5970af4b4dd4d1735c6c Mon Sep 17 00:00:00 2001 From: Benjamin Kramer Date: Sat, 28 Sep 2013 21:27:49 +0000 Subject: [PATCH] Add a test that large offsets on GEPs on 32 bits targets are handled correctly. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@191628 91177308-0d34-0410-b5e6-96231b3b80d8 --- test/Transforms/InstSimplify/compare.ll | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/test/Transforms/InstSimplify/compare.ll b/test/Transforms/InstSimplify/compare.ll index 83705aac853..abb38695e71 100644 --- a/test/Transforms/InstSimplify/compare.ll +++ b/test/Transforms/InstSimplify/compare.ll @@ -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 +}