struct / union in initializer, RFE #901.
[sdcc.git] / sdcc / support / regression / tests / gcc-torture-execute-20000113-1.c
blob3803e03e5f2ffe6242c496a316c3561619a513af
1 /*
2 20000113-1.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 x {
12 unsigned x1:1;
13 unsigned x2:2;
14 unsigned x3:3;
17 void foobar (int x, int y, int z)
19 struct x a = {x, y, z};
20 struct x b = {x, y, z};
21 struct x *c = &b;
23 c->x3 += (a.x2 - a.x1) * c->x2;
24 if (a.x1 != 1 || c->x3 != 5)
25 ASSERT (0);
26 return;
29 void
30 testTortureExecute (void)
32 foobar (1, 2, 3);