aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--test/Transforms/ScalarRepl/union-packed.ll12
1 files changed, 12 insertions, 0 deletions
diff --git a/test/Transforms/ScalarRepl/union-packed.ll b/test/Transforms/ScalarRepl/union-packed.ll
new file mode 100644
index 0000000000..0df6e3957f
--- /dev/null
+++ b/test/Transforms/ScalarRepl/union-packed.ll
@@ -0,0 +1,12 @@
+; RUN: llvm-upgrade < %s | llvm-as | opt -scalarrepl | llvm-dis | not grep alloca &&
+; RUN: llvm-upgrade < %s | llvm-as | opt -scalarrepl | llvm-dis | grep 'bitcast'
+
+target endian = little
+
+<4 x int> %test(<4 x float> %X) {
+ %X_addr = alloca <4 x float>
+ store <4 x float> %X, <4 x float>* %X_addr
+ %X_addr = bitcast <4 x float>* %X_addr to <4 x int>*
+ %tmp = load <4 x int>* %X_addr
+ ret <4 x int> %tmp
+}