struct / union in initializer, RFE #901.
[sdcc.git] / sdcc / support / regression / tests / bug1717943.c
blobaf653be09a792510227c3426dc8e42020c226d99
1 /*
2 bug1717943c.c
3 an error in the detection of loopinvariants,
4 will move the foo=0 initialisation out of the loops.
5 */
7 #include <testfwk.h>
9 char foo, firstcall;
11 char check(void)
13 if(!firstcall)
14 return 1;
16 firstcall=0;
17 foo = 42;
18 return 0;
21 void bug(void)
23 while(1) {
24 foo = 0;
25 while(check())
26 if(check())
27 return;
32 void
33 testBug(void)
35 firstcall = 1;
36 bug();
37 ASSERT(foo == 0);