blob: 6098bcc5a07ce733af45d1ec1fe1cf36e12fb70b [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 &&
Chris Lattner6f877cd2009-03-01 00:59:19 +00003// 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 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;