struct / union in initializer, RFE #901.
[sdcc.git] / sdcc / support / regression / tests / gcc-torture-execute-990106-2.c
blobe194ba1232f335ee9da314f29194b7a725dee2a1
1 /*
2 990106-2.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 unsigned calc_mp(unsigned mod)
13 unsigned a,b,c;
14 c=-1;
15 a=c/mod;
16 b=0-a*mod;
17 if (b > mod) { a += 1; b-=mod; }
18 return b;
21 void
22 testTortureExecute (void)
24 unsigned x = 1234;
25 unsigned y = calc_mp(x);
27 if ((sizeof (y) == 4 && y != 680)
28 || (sizeof (y) == 2 && y != 134))
29 ASSERT (0);
30 return;