* gcc.dg/const-elim-1.c: xfail for xtensa.
[official-gcc.git] / gcc / testsuite / gcc.c-torture / compat / struct-align.c
blob69fe6b335ca06d778487848eb5aea6651e1fba3f
1 typedef union
3 struct {int a; int b;} s;
4 double d;
5 } T;
7 int h (T *);
8 T g (T);
10 #if COMPILER != 1
11 h (T *x)
13 if (x->s.a != 0 || x->s.b != 1)
14 abort ();
16 #endif
18 #if COMPILER != 2
20 g (T x)
22 if (x.s.a != 13 || x.s.b != 47)
23 abort ();
24 x.s.a = 0;
25 x.s.b = 1;
26 h (&x);
27 return x;
29 #endif
31 #if COMPILER != 1
32 f ()
34 T x;
35 x.s.a = 13;
36 x.s.b = 47;
37 g (x);
38 if (x.s.a != 13 || x.s.b != 47)
39 abort ();
40 x = g (x);
41 if (x.s.a != 0 || x.s.b != 1)
42 abort ();
44 #endif
46 #if COMPILER != 2
47 main ()
49 f ();
50 exit (0);
52 #endif