struct / union in initializer, RFE #901.
[sdcc.git] / sdcc / support / regression / tests / gcc-torture-execute-950809-1.c
blob864995544e86f912f20a06b28cac4e039fd4d8e8
1 /*
2 950809-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
13 int *sp, fc, *sc, a[2];
16 void
17 f (struct S *x)
19 int *t = x->sc;
20 int t1 = t[0];
21 int t2 = t[1];
22 int t3 = t[2];
23 int a0 = x->a[0];
24 int a1 = x->a[1];
25 t[2] = t1;
26 t[0] = a1;
27 x->a[1] = a0;
28 x->a[0] = t3;
29 x->fc = t2;
30 x->sp = t;
33 void
34 testTortureExecute (void)
36 struct S s;
37 static int sc[3] = {2, 3, 4};
38 s.sc = sc;
39 s.a[0] = 10;
40 s.a[1] = 11;
41 f (&s);
42 ASSERT(s.sp[2] == 2);
43 return;