diff options
Diffstat (limited to 'test/CodeGen/cast-to-union.c')
-rw-r--r-- | test/CodeGen/cast-to-union.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/test/CodeGen/cast-to-union.c b/test/CodeGen/cast-to-union.c new file mode 100644 index 0000000..03aee3e --- /dev/null +++ b/test/CodeGen/cast-to-union.c @@ -0,0 +1,13 @@ +// RUN: clang-cc -emit-llvm < %s -o %t && +// RUN: grep "store i32 351, i32*" %t && +// RUN: grep "w = global %0 <{ i32 2, i8 0, i8 0, i8 0, i8 0 }>" %t && +// RUN: grep "y = global %1 <{ double 7.300000e+01 }>" %t + +union u { int i; double d; }; + +void foo() { + union u ola = (union u) 351; +} + +union u w = (union u)2; +union u y = (union u)73.0; |