struct / union in initializer, RFE #901.
[sdcc.git] / sdcc / support / regression / tests / gcc-torture-execute-20021120-3.c
blobd62d29c1a77fa7e9d76134e3ab4badeb07c4cb9d
1 /*
2 20021120-3.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 #include <stdio.h>
13 #if !defined(__SDCC_pdk14) && !defined(__SDCC_pdk15) // Lack of memory
14 unsigned int foo (char *c, unsigned int x, unsigned int y)
16 register unsigned int z;
18 sprintf (c, "%d", x / y);
19 z = x + 1;
20 return z / (y + 1);
22 #endif
24 void
25 testTortureExecute (void)
27 #if !defined(__SDCC_pdk14) && !defined(__SDCC_pdk15) // Lack of memory
28 char c[16];
30 if (foo (c, ~1U, 4) != (~0U / 5))
31 ASSERT (0);
32 return;
33 #endif