summaryrefslogtreecommitdiffstats
path: root/llvm/test/Analysis/BasicAA
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2011-01-03 21:03:33 +0000
committerChris Lattner <sabre@nondot.org>2011-01-03 21:03:33 +0000
commit16e42128c24f5df8a61cfd2e6cdf3bd3966db0c5 (patch)
tree5dfc380adc19d64738b91972f2767124a8797ae1 /llvm/test/Analysis/BasicAA
parent12fa3c6a94af24ef5029fbd65723128aa9875226 (diff)
downloadbcm5719-llvm-16e42128c24f5df8a61cfd2e6cdf3bd3966db0c5.tar.gz
bcm5719-llvm-16e42128c24f5df8a61cfd2e6cdf3bd3966db0c5.zip
fix rdar://8813415 - a miscompilation of 164.gzip that loop-idiom
exposed. It turns out to be a latent bug in basicaa, scary. llvm-svn: 122772
Diffstat (limited to 'llvm/test/Analysis/BasicAA')
-rw-r--r--llvm/test/Analysis/BasicAA/global-size.ll22
1 files changed, 22 insertions, 0 deletions
diff --git a/llvm/test/Analysis/BasicAA/global-size.ll b/llvm/test/Analysis/BasicAA/global-size.ll
index 810322e54d1..a7e5aab6c1f 100644
--- a/llvm/test/Analysis/BasicAA/global-size.ll
+++ b/llvm/test/Analysis/BasicAA/global-size.ll
@@ -16,3 +16,25 @@ define i16 @test1(i32* %P) {
; CHECK: ret i16 0
}
+; Cannot know anything about the size of this global.
+; rdar://8813415
+@window = external global [0 x i8]
+
+; CHECK: @test2
+define i8 @test2(i32 %tmp79, i32 %w.2, i32 %indvar89) nounwind {
+ %tmp92 = add i32 %tmp79, %indvar89
+ %arrayidx412 = getelementptr [0 x i8]* @window, i32 0, i32 %tmp92
+ %tmp93 = add i32 %w.2, %indvar89
+ %arrayidx416 = getelementptr [0 x i8]* @window, i32 0, i32 %tmp93
+
+ %A = load i8* %arrayidx412, align 1
+ store i8 4, i8* %arrayidx416, align 1
+
+ %B = load i8* %arrayidx412, align 1
+ %C = sub i8 %A, %B
+ ret i8 %C
+
+; CHECK: %B = load i8
+; CHECK: ret i8 %C
+}
+
OpenPOWER on IntegriCloud