summaryrefslogtreecommitdiff
path: root/test/Feature
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2010-02-12 20:49:41 +0000
committerChris Lattner <sabre@nondot.org>2010-02-12 20:49:41 +0000
commitfdfeb6976f07ad10d809b922ed7376ba2a3539be (patch)
treef6ba4446fc9db081e5e3386c57d2db253774c1fa /test/Feature
parentb3e1bf54b29354c6d332cfaffcc86cd776fd4ca8 (diff)
downloadllvm-fdfeb6976f07ad10d809b922ed7376ba2a3539be.tar.gz
llvm-fdfeb6976f07ad10d809b922ed7376ba2a3539be.tar.bz2
llvm-fdfeb6976f07ad10d809b922ed7376ba2a3539be.tar.xz
Add support for a union type in LLVM IR. Patch by Talin!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96011 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Feature')
-rw-r--r--test/Feature/unions.ll12
1 files changed, 12 insertions, 0 deletions
diff --git a/test/Feature/unions.ll b/test/Feature/unions.ll
new file mode 100644
index 0000000000..9d6c36bb3c
--- /dev/null
+++ b/test/Feature/unions.ll
@@ -0,0 +1,12 @@
+; RUN: llvm-as < %s | llvm-dis > %t1.ll
+; RUN: llvm-as %t1.ll -o - | llvm-dis > %t2.ll
+; RUN: diff %t1.ll %t2.ll
+
+%union.anon = type union { i8, i32, float }
+
+@union1 = constant union { i32, i8 } { i32 4 }
+@union2 = constant union { i32, i8 } insertvalue(union { i32, i8 } undef, i32 4, 0)
+
+define void @"Unions" () {
+ ret void
+}