Nuno Lopes | 81e51e2 | 2009-01-17 00:48:48 +0000 | [diff] [blame] | 1 | // RUN: clang -emit-llvm < %s -o %t && |
| 2 | // RUN: grep "store i32 351, i32*" %t && |
Chris Lattner | 6f877cd | 2009-03-01 00:59:19 +0000 | [diff] [blame] | 3 | // RUN: grep "w = global %0 <{ i32 2, i8 0, i8 0, i8 0, i8 0 }>" %t && |
| 4 | // RUN: grep "y = global %1 <{ double 7.300000e+01 }>" %t |
Nuno Lopes | 7e91627 | 2009-01-15 20:14:33 +0000 | [diff] [blame] | 5 | |
Nuno Lopes | 81e51e2 | 2009-01-17 00:48:48 +0000 | [diff] [blame] | 6 | union u { int i; double d; }; |
Nuno Lopes | 7e91627 | 2009-01-15 20:14:33 +0000 | [diff] [blame] | 7 | |
| 8 | void foo() { |
| 9 | union u ola = (union u) 351; |
| 10 | } |
| 11 | |
Nuno Lopes | 81e51e2 | 2009-01-17 00:48:48 +0000 | [diff] [blame] | 12 | union u w = (union u)2; |
| 13 | union u y = (union u)73.0; |