struct / union in initializer, RFE #901.
[sdcc.git] / sdcc / support / regression / tests / gcc-torture-execute-pr20466-1.c
blob1bb4547cf651656f7aca1f0cee769e732856c12d
1 /*
2 pr20466-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 #if !(defined(__SDCC_pic14) && !defined(__SDCC_PIC14_ENHANCED)) // Pseudo-stack size limit
12 int f (int **, int *, int *, int **, int **);
13 int
14 f (int **ipp, int *i1p, int *i2p, int **i3, int **i4)
16 **ipp = *i1p;
17 *ipp = i2p;
18 *i3 = *i4;
19 **ipp = 99;
20 return 3;
22 #endif
24 void
25 testTortureExecute (void)
27 int i = 42, i1 = 66, i2 = 1, i3 = -1, i4 = 55;
28 int *ip = &i;
29 int *i3p = &i3;
30 int *i4p = &i4;
31 #if !(defined(__SDCC_pic14) && !defined(__SDCC_PIC14_ENHANCED)) // Pseudo-stack size limit
32 f (&ip, &i1, &i2, &i3p, &i4p);
33 if (i != 66 || ip != &i2 || i2 != 99 || i3 != -1 || i3p != i4p || i4 != 55)
34 ASSERT (0);
35 return;
36 #endif