struct / union in initializer, RFE #901.
[sdcc.git] / sdcc / support / regression / tests / gcc-torture-execute-20060929-1.c
blobe2f0ff98e6b6cd9c72f0f51f9ab4ee575b12fe8f
1 /*
2 20060929-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 /* PR c/29154 */
13 void
14 foo (int **p, int *q)
16 *(*p++)++ = *q++;
19 void
20 bar (int **p, int *q)
22 **p = *q++;
23 *(*p++)++;
26 void
27 baz (int **p, int *q)
29 **p = *q++;
30 (*p++)++;
33 void
34 testTortureExecute (void)
36 #if !(defined (__GNUC__) && (__GNUC__ < 5))
37 int i = 42, j = 0;
38 int *p = &i;
39 foo (&p, &j);
40 if (p - 1 != &i || j != 0 || i != 0)
41 ASSERT (0);
42 i = 43;
43 p = &i;
44 bar (&p, &j);
45 if (p - 1 != &i || j != 0 || i != 0)
46 ASSERT (0);
47 i = 44;
48 p = &i;
49 baz (&p, &j);
50 if (p - 1 != &i || j != 0 || i != 0)
51 ASSERT (0);
52 return;
53 #endif