Pick three bugfixes from next branch to trunk for inclusion in 4.5.0 RC2, as discusse...
[sdcc.git] / sdcc / support / regression / tests / bug-3007.c.in
blob1acc518e87277d60056443379c14ab4466206fc5
1 /* bug 3007
2 type: char, int, long, long long
3 */
4 #include <testfwk.h>
6 {type} a = 0;
8 void inc(void)
10 a++;
13 void testBug(void)
15 {type} i;
16 for (i = 0; i < ({type})300; i++)
17 inc();
18 ASSERT (a == ({type})300);
21 {type} a1, a2;
23 void inc2(void)
25 while(--a1)
26 a2++;
29 void testBug2(void)
31 a1 = 31;
32 inc2();
33 ASSERT(a1 == 0);
34 ASSERT(a2 == 30);