struct / union in initializer, RFE #901.
[sdcc.git] / sdcc / support / regression / tests / gcc-torture-execute-981130-1.c
blob140f9bb0af758fe5efffd23f258e3730ca05302b
1 /*
2 981130-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 struct s { int a; int b;};
12 struct s s1;
13 struct s s2 = { 1, 2, };
15 void
16 check (int a, int b)
18 if (a == b)
19 return;
20 else
21 ASSERT (0);
24 void
25 testTortureExecute (void)
27 int * p;
28 int x;
30 s1.a = 9;
31 p = & s1.a;
32 s1 = s2;
33 x = * p;
35 check (x, 1);