aboutsummaryrefslogtreecommitdiff
path: root/test/CodeGen/union.c
diff options
context:
space:
mode:
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);
+}