OSDN Git Service

new testcase for SROA for stuff like "union { int*, float* }".
authorChris Lattner <sabre@nondot.org>
Sun, 8 Oct 2006 23:27:37 +0000 (23:27 +0000)
committerChris Lattner <sabre@nondot.org>
Sun, 8 Oct 2006 23:27:37 +0000 (23:27 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30822 91177308-0d34-0410-b5e6-96231b3b80d8

test/Transforms/ScalarRepl/union-pointer.ll [new file with mode: 0644]

diff --git a/test/Transforms/ScalarRepl/union-pointer.ll b/test/Transforms/ScalarRepl/union-pointer.ll
new file mode 100644 (file)
index 0000000..427ceec
--- /dev/null
@@ -0,0 +1,18 @@
+
+; RUN: llvm-as < %s | opt -scalarrepl | llvm-dis | not grep alloca &&
+; RUN: llvm-as < %s | opt -scalarrepl | llvm-dis | grep 'ret sbyte'
+
+target endian = little
+target pointersize = 32
+target triple = "i686-apple-darwin8.7.2"
+
+implementation   ; Functions:
+
+sbyte* %test(short* %X) {
+        %X_addr = alloca short*
+        store short* %X, short** %X_addr
+        %X_addr = cast short** %X_addr to sbyte**
+        %tmp = load sbyte** %X_addr
+        ret sbyte* %tmp
+}
+