summaryrefslogtreecommitdiffstats
path: root/llvm/test
diff options
context:
space:
mode:
authorEli Friedman <eli.friedman@gmail.com>2009-06-06 06:32:50 +0000
committerEli Friedman <eli.friedman@gmail.com>2009-06-06 06:32:50 +0000
commit75c496f920fd3af2509bde22a9e1844f1d3bffd1 (patch)
treee68e9e6298dc0f37c4007c4315e4599ce6b17d79 /llvm/test
parent8667990cdf3327e8d12a93772c6d3899a4d1f282 (diff)
downloadbcm5719-llvm-75c496f920fd3af2509bde22a9e1844f1d3bffd1.tar.gz
bcm5719-llvm-75c496f920fd3af2509bde22a9e1844f1d3bffd1.zip
Avoid crashing on a variable-index insertelement with element type i16.
llvm-svn: 72991
Diffstat (limited to 'llvm/test')
-rw-r--r--llvm/test/CodeGen/X86/2009-06-05-VariableIndexInsert.ll11
1 files changed, 11 insertions, 0 deletions
diff --git a/llvm/test/CodeGen/X86/2009-06-05-VariableIndexInsert.ll b/llvm/test/CodeGen/X86/2009-06-05-VariableIndexInsert.ll
new file mode 100644
index 00000000000..2e3f195ff94
--- /dev/null
+++ b/llvm/test/CodeGen/X86/2009-06-05-VariableIndexInsert.ll
@@ -0,0 +1,11 @@
+; RUN: llvm-as < %s | llc
+
+define <2 x i64> @_mm_insert_epi16(<2 x i64> %a, i32 %b, i32 %imm) nounwind readnone {
+entry:
+ %conv = bitcast <2 x i64> %a to <8 x i16> ; <<8 x i16>> [#uses=1]
+ %conv2 = trunc i32 %b to i16 ; <i16> [#uses=1]
+ %and = and i32 %imm, 7 ; <i32> [#uses=1]
+ %vecins = insertelement <8 x i16> %conv, i16 %conv2, i32 %and ; <<8 x i16>> [#uses=1]
+ %conv6 = bitcast <8 x i16> %vecins to <2 x i64> ; <<2 x i64>> [#uses=1]
+ ret <2 x i64> %conv6
+}
OpenPOWER on IntegriCloud