blob: 9c61a840ecdd5ed612abbbaec175ad647f232264 [file] [log] [blame]
Daniel Dunbard7d5f022009-03-24 02:24:46 +00001// RUN: clang-cc -emit-llvm < %s -o %t &&
Nuno Lopes81e51e22009-01-17 00:48:48 +00002// RUN: grep "store i32 351, i32*" %t &&
Anders Carlsson20d6d042009-07-23 04:50:01 +00003// RUN: grep "w = global %0 { i32 2, \[4 x i8\] zeroinitializer }" %t &&
Anders Carlssonabdad352009-07-27 15:31:55 +00004// RUN: grep "y = global %union.u { double 7.300000e+01 }" %t
Nuno Lopes7e916272009-01-15 20:14:33 +00005
Nuno Lopes81e51e22009-01-17 00:48:48 +00006union u { int i; double d; };
Nuno Lopes7e916272009-01-15 20:14:33 +00007
8void foo() {
9 union u ola = (union u) 351;
Eli Friedman34ebf4d2009-06-03 20:45:06 +000010 union u olb = (union u) 1.0;
Nuno Lopes7e916272009-01-15 20:14:33 +000011}
12
Nuno Lopes81e51e22009-01-17 00:48:48 +000013union u w = (union u)2;
14union u y = (union u)73.0;