struct / union in initializer, RFE #901.
[sdcc.git] / sdcc / support / regression / tests / gcc-torture-execute-20131127-1.c
blob14490e0e4f7d9fff80e683e3f1680232c4980cd9
1 /*
2 20131127-1.c from the execute part of the gcc torture suite.
3 */
5 #include <testfwk.h>
7 #ifdef __SDCC
8 #pragma std_c99
9 #endif
11 /* PR middle-end/59138 */
12 /* Testcase by John Regehr <regehr@cs.utah.edu> */
14 struct S0 {
15 int f0;
16 int f1;
17 int f2;
18 short f3;
21 short a = 1;
23 struct S0 b = { 1 }, c, d, e;
24 #if !defined(__SDCC_ds390) && !defined(__SDCC_ds390) && !defined(__SDCC_hc08) && !defined(__SDCC_s08) // struct return not yet supported
25 struct S0 fn1() { return c; }
27 void fn2 (void)
29 b = fn1 ();
30 a = 0;
31 d = e;
33 #endif
34 void
35 testTortureExecute (void)
37 #if !defined(__SDCC_ds390) && !defined(__SDCC_ds390) && !defined(__SDCC_hc08) && !defined(__SDCC_s08) // struct return not yet supported
38 fn2 ();
39 if (a != 0)
40 ASSERT (0);
41 #endif