Fix inserting new elements in a specified location.
[oota-llvm.git] / test / Transforms / ScalarRepl / 2011-06-08-VectorExtractValue.ll
index 8da03cf32c23cef239f23586ae11aeab7383827a..459688547fb47a33f1b108331aa596a1a25393f9 100644 (file)
@@ -59,3 +59,17 @@ entry:
   %r = fadd float %r1, %r2
   ret float %r
 }
+
+; CHECK: test3
+; CHECK: %[[A:[a-z0-9]*]] = extractelement <2 x float> <float 2.000000e+00, float 3.000000e+00>, i32 1
+; CHECK: ret float %[[A]]
+
+define float @test3() {
+entry:
+  %ai = alloca { <2 x float>, <2 x float> }, align 8
+  store { <2 x float>, <2 x float> } {<2 x float> <float 0.0, float 1.0>, <2 x float> <float 2.0, float 3.0>}, { <2 x float>, <2 x float> }* %ai, align 8
+  %tmpcast = bitcast { <2 x float>, <2 x float> }* %ai to [4 x float]*
+  %arrayidx = getelementptr inbounds [4 x float]* %tmpcast, i64 0, i64 3
+  %f = load float* %arrayidx, align 4
+  ret float %f
+}