aboutsummaryrefslogtreecommitdiff
path: root/test/Analysis
diff options
context:
space:
mode:
authorEli Friedman <eli.friedman@gmail.com>2010-09-15 20:08:03 +0000
committerEli Friedman <eli.friedman@gmail.com>2010-09-15 20:08:03 +0000
commit39e30124e50534972c2e58f4dab7d67c0c437743 (patch)
tree59b24fd99818b00bf4ee5e5627341252763b7b6b /test/Analysis
parentf1c3eb37ae96572e1df34bf980b9ecd149b5ee33 (diff)
PR7959: Handle negative scales in GEPs correctly in BasicAA for non-64-bit
targets. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114015 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Analysis')
-rw-r--r--test/Analysis/BasicAA/2010-09-15-GEP-SignedArithmetic.ll15
1 files changed, 15 insertions, 0 deletions
diff --git a/test/Analysis/BasicAA/2010-09-15-GEP-SignedArithmetic.ll b/test/Analysis/BasicAA/2010-09-15-GEP-SignedArithmetic.ll
new file mode 100644
index 0000000000..2b0cd78fec
--- /dev/null
+++ b/test/Analysis/BasicAA/2010-09-15-GEP-SignedArithmetic.ll
@@ -0,0 +1,15 @@
+; RUN: opt < %s -basicaa -aa-eval -print-all-alias-modref-info -disable-output |& grep {1 may alias}
+; PR7959
+
+target datalayout = "e-p:32:32:32"
+
+define i32 @test(i32* %tab, i32 %indvar) nounwind {
+ %tmp31 = mul i32 %indvar, -2
+ %tmp32 = add i32 %tmp31, 30
+ %t.5 = getelementptr i32* %tab, i32 %tmp32
+ %loada = load i32* %tab
+ store i32 0, i32* %t.5
+ %loadb = load i32* %tab
+ %rval = add i32 %loada, %loadb
+ ret i32 %rval
+}