struct / union in initializer, RFE #901.
[sdcc.git] / sdcc / support / regression / tests / gcc-torture-execute-pta-field-1.c
blob3cd4ce18f1c7f11f594415fd0fb0c673ea37ec05
1 /*
2 pta-field-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 Foo {
12 int *p;
13 int *q;
16 void
17 bar (int **x)
19 struct Foo *f = (struct Foo *)x;
20 *(f->q) = 0;
23 int foo(void)
25 struct Foo f;
26 int i = 1, j = 2;
27 f.p = &i;
28 f.q = &j;
29 bar(&f.p);
30 return j;
33 void
34 testTortureExecute (void)
36 if (foo () != 0)
37 ASSERT (0);
38 return;