From 1ce0eaa25fc6ecead5f9bba3c17b8af612d830ef Mon Sep 17 00:00:00 2001
From: Chris Lattner <sabre@nondot.org>
Date: Thu, 26 Nov 2009 18:53:33 +0000
Subject: Implement PR1143 (at -m64) by making basicaa look through extensions.
  We previously already handled it at -m32 because there were no i32->i64
 extensions for addressing.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@89959 91177308-0d34-0410-b5e6-96231b3b80d8
---
 test/Analysis/BasicAA/gep-alias.ll | 17 ++++++++++++++++-
 1 file changed, 16 insertions(+), 1 deletion(-)

(limited to 'test/Analysis')

diff --git a/test/Analysis/BasicAA/gep-alias.ll b/test/Analysis/BasicAA/gep-alias.ll
index 68722fb..0eb8bb0 100644
--- a/test/Analysis/BasicAA/gep-alias.ll
+++ b/test/Analysis/BasicAA/gep-alias.ll
@@ -115,4 +115,19 @@ define i32 @test7(i32* %p, i64 %i) {
 ; CHECK: ret i32 0
 }
 
-
+; P[zext(i)] != p[zext(i+1)]
+; PR1143
+define i32 @test8(i32* %p, i32 %i) {
+  %i1 = zext i32 %i to i64
+  %pi = getelementptr i32* %p, i64 %i1
+  %i.next = add i32 %i, 1
+  %i.next2 = zext i32 %i.next to i64
+  %pi.next = getelementptr i32* %p, i64 %i.next2
+  %x = load i32* %pi
+  store i32 42, i32* %pi.next
+  %y = load i32* %pi
+  %z = sub i32 %x, %y
+  ret i32 %z
+; CHECK: @test8
+; CHECK: ret i32 0
+}
-- 
cgit v1.1