aboutsummaryrefslogtreecommitdiff
path: root/test/CodeGen/union.c
diff options
context:
space:
mode:
authorDevang Patel <dpatel@apple.com>2007-10-26 19:42:18 +0000
committerDevang Patel <dpatel@apple.com>2007-10-26 19:42:18 +0000
commitabad06cfd01edbd6ffe80856304b5ad991b67d08 (patch)
tree7e5d788c1c3611ebeae6b53eeb7452f3b684b7ef /test/CodeGen/union.c
parent0a96118bb8cec6224aef53f001a0a4f87a7be8fb (diff)
Codegen union member references.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43390 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CodeGen/union.c')
-rw-r--r--test/CodeGen/union.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/test/CodeGen/union.c b/test/CodeGen/union.c
new file mode 100644
index 0000000000..8102f9b6fd
--- /dev/null
+++ b/test/CodeGen/union.c
@@ -0,0 +1,18 @@
+// RUN: clang %s -emit-llvm
+
+union {
+ int a;
+ float b;
+} u;
+
+void f() {
+ u.b = 11;
+}
+
+int f2( float __x ) {
+ union{
+ float __f;
+ unsigned int __u;
+ }__u;
+ return (int)(__u.__u >> 31);
+}