aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2010-04-10 18:19:22 +0000
committerChris Lattner <sabre@nondot.org>2010-04-10 18:19:22 +0000
commita2fb234b04eb632fb23aff72e56fd3962aa56e65 (patch)
tree966f4cc5ab155f4d9385b8befbdb5c59f3883465 /test
parentf7240de877e790d9e377c1fe49b6d7a14c1a9674 (diff)
downloadexternal_llvm-a2fb234b04eb632fb23aff72e56fd3962aa56e65.zip
external_llvm-a2fb234b04eb632fb23aff72e56fd3962aa56e65.tar.gz
external_llvm-a2fb234b04eb632fb23aff72e56fd3962aa56e65.tar.bz2
fix PR6760, a missing check in heap SRoA.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100936 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test')
-rw-r--r--test/Transforms/GlobalOpt/crash.ll28
1 files changed, 27 insertions, 1 deletions
diff --git a/test/Transforms/GlobalOpt/crash.ll b/test/Transforms/GlobalOpt/crash.ll
index a45cbe9..701472c 100644
--- a/test/Transforms/GlobalOpt/crash.ll
+++ b/test/Transforms/GlobalOpt/crash.ll
@@ -9,8 +9,34 @@ target triple = "i386-apple-darwin9.8"
@_ZL6vTwist = global %struct.btSimdScalar zeroinitializer ; <%struct.btSimdScalar*> [#uses=1]
@llvm.global_ctors = appending global [1 x %0] [%0 { i32 65535, void ()* @_GLOBAL__I__ZN21btConeTwistConstraintC2Ev }] ; <[12 x %0]*> [#uses=0]
-define internal void @_GLOBAL__I__ZN21btConeTwistConstraintC2Ev() nounwind section "__TEXT,__StaticInit,regular,pure_instructions" {
+define internal void @_GLOBAL__I__ZN21btConeTwistConstraintC2Ev() nounwind section "__TEXT,__StaticInit,regular,pure_instructions" {
entry:
store float 1.0, float* getelementptr inbounds (%struct.btSimdScalar* @_ZL6vTwist, i32 0, i32 0, i32 0, i32 3), align 4
ret void
}
+
+
+; PR6760
+%T = type { [5 x i32] }
+
+@switch_inf = internal global %T* null
+
+define void @test(i8* %arch_file, i32 %route_type) {
+entry:
+ %A = sext i32 1 to i64
+ %B = mul i64 %A, 20
+ %C = call noalias i8* @malloc(i64 %B) nounwind
+ %D = bitcast i8* %C to %T*
+ store %T* %D, %T** @switch_inf, align 8
+ unreachable
+
+bb.nph.i:
+ %scevgep.i539 = getelementptr i8* %C, i64 4
+ unreachable
+
+xx:
+ %E = load %T** @switch_inf, align 8
+ unreachable
+}
+
+declare noalias i8* @malloc(i64) nounwind