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 && |
| 3 | // RUN: grep "w = global <{ i32, i8, i8, i8, i8 }> <{ i32 2, i8 0, i8 0, i8 0, i8 0 }>" %t && |
| 4 | // RUN: grep "y = global <{ double }> <{ 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; |