Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / clang / test / CodeGen / union.c
blob60e9e2d771ff19bb2c055ff9e9dd8a8469b4d23f
1 // RUN: %clang_cc1 %s -emit-llvm -o -
3 union u_tag {
4 int a;
5 float b;
6 } u;
8 void f(void) {
9 u.b = 11;
12 float get_b(union u_tag *my_u) {
13 return my_u->b;
16 int f2( float __x ) {
17 union{
18 float __f;
19 unsigned int __u;
20 }__u;
21 return (int)(__u.__u >> 31);
24 typedef union { int i; int *j; } value;
26 int f3(value v) {
27 return *v.j;
30 enum E9 { one, two };
31 union S65 { enum E9 a; } ; union S65 s65;
32 void fS65(void) { enum E9 e = s65.a; }
34 typedef union{
35 unsigned char x[65536];
36 } q;
37 int qfunc(void) {q buf; unsigned char* x = buf.x;}
39 union RR {_Bool a : 1;} RRU;
40 int RRF(void) {return RRU.a;}
42 // PR6164
43 typedef union T0 { unsigned int : 0; } T0;
44 T0 t0;
46 union { int large_bitfield: 31; char c } u2;
48 struct dt_t_s {
49 union {
50 long long u : 56;
51 } __attribute__((packed));
53 struct {
54 struct {
55 struct {
56 struct dt_t_s t;
59 } a;