diff options
author | Chris Lattner <sabre@nondot.org> | 2010-01-07 01:16:21 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2010-01-07 01:16:21 +0000 |
commit | a0e9a2475cd6e45966a591de8e0740a102fe0dfe (patch) | |
tree | 9c4033d94d48d1ca9d2c906c03764170045a1a9c /test/Transforms | |
parent | 17751dac3e0a7b7a8cdf9bd612ce20f157eb251f (diff) | |
download | llvm-a0e9a2475cd6e45966a591de8e0740a102fe0dfe.tar.gz llvm-a0e9a2475cd6e45966a591de8e0740a102fe0dfe.tar.bz2 llvm-a0e9a2475cd6e45966a591de8e0740a102fe0dfe.tar.xz |
fix a globalopt crash on 'bullet' (handling evaluation of a store
to an element of a vector in a static ctor) which occurs with an
unrelated patch I'm testing. Annoyingly, EvaluateStoreInto basically
does exactly the same stuff as InsertElement constant folding, but it
now handles vectors, and you can't insertelement into a vector. It
would be 'really nice' if GEP into a vector were not legal.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92889 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Transforms')
-rw-r--r-- | test/Transforms/GlobalOpt/crash.ll | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/test/Transforms/GlobalOpt/crash.ll b/test/Transforms/GlobalOpt/crash.ll new file mode 100644 index 0000000000..a45cbe9c0f --- /dev/null +++ b/test/Transforms/GlobalOpt/crash.ll @@ -0,0 +1,16 @@ +; RUN: opt -globalopt -disable-output %s +target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:128:128-n8:16:32" +target triple = "i386-apple-darwin9.8" + +%0 = type { i32, void ()* } +%struct.btSimdScalar = type { %"union.btSimdScalar::$_14" } +%"union.btSimdScalar::$_14" = type { <4 x float> } + +@_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" { +entry: + store float 1.0, float* getelementptr inbounds (%struct.btSimdScalar* @_ZL6vTwist, i32 0, i32 0, i32 0, i32 3), align 4 + ret void +} |