struct / union in initializer, RFE #901.
[sdcc.git] / sdcc / support / regression / tests / gcc-torture-execute-20031011-1.c
blob6099222c09a6ec2f2a47fbfa3a7e01206a50153d
1 /*
2 20031011-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 /* Check that MAX_EXPR and MIN_EXPR are working properly. */
13 #define MAX(X,Y) ((X) > (Y) ? (X) : (Y))
14 #define MIN(X,Y) ((X) < (Y) ? (X) : (Y))
16 void
17 testTortureExecute (void)
19 int ll_bitsize, ll_bitpos;
20 int rl_bitsize, rl_bitpos;
21 int end_bit;
23 ll_bitpos = 32; ll_bitsize = 32;
24 rl_bitpos = 0; rl_bitsize = 32;
26 end_bit = MAX (ll_bitpos + ll_bitsize, rl_bitpos + rl_bitsize);
27 if (end_bit != 64)
28 ASSERT (0);
29 end_bit = MAX (rl_bitpos + rl_bitsize, ll_bitpos + ll_bitsize);
30 if (end_bit != 64)
31 ASSERT (0);
32 end_bit = MIN (ll_bitpos + ll_bitsize, rl_bitpos + rl_bitsize);
33 if (end_bit != 32)
34 ASSERT (0);
35 end_bit = MIN (rl_bitpos + rl_bitsize, ll_bitpos + ll_bitsize);
36 if (end_bit != 32)
37 ASSERT (0);
38 return;