struct / union in initializer, RFE #901.
[sdcc.git] / sdcc / support / regression / tests / gcc-torture-execute-pr29156.c
blobcece2a7f0e503753ec4e2fe06b4ceacecd666dc8
1 /*
2 pr29156.c from the execute part of the gcc torture tests.
3 */
5 #include <testfwk.h>
7 #ifdef __SDCC
8 #pragma std_c99
9 #endif
11 struct test1
13 int a;
14 int b;
16 struct test2
18 float d;
19 struct test1 sub;
22 int global;
24 int bla(struct test1 *xa, struct test2 *xb)
26 global = 1;
27 xb->sub.a = 1;
28 xa->a = 8;
29 return xb->sub.a;
32 void
33 testTortureExecute (void)
35 struct test2 pom;
37 if (bla (&pom.sub, &pom) != 8)
38 ASSERT (0);
40 return;