struct / union in initializer, RFE #901.
[sdcc.git] / sdcc / support / regression / tests / bug-2982.c
blob1ce29c36b76e33928a6970a9842eb47e6f5cfc57
1 /* bug-2982.c
2 A bug in the z80 peephole optimizer.
3 */
5 #include <testfwk.h>
7 #pragma disable_warning 85
9 static int L, STEP;
11 void Basic_PRINT(int i)
13 ASSERT (i == 36);
16 signed char Basic_RND(char a)
18 return 51;
21 int f(int argc, char **argv)
23 STEP = Basic_RND(0);
24 do {
25 // A load of L into register pair de got optimized out, though it was still needed for the calculation of L + 50
26 Basic_PRINT((L + 50) / 100);
27 L += STEP;
28 } while (!(L > 3600));
31 void testBug(void)
33 L = 3550;
34 f(0, 0);