Pick three bugfixes from next branch to trunk for inclusion in 4.5.0 RC2, as discusse...
[sdcc.git] / sdcc / support / regression / tests / bug-3525.c
blobbf0deb75ffa6ed3002f94e78c6d87ed67fba8361
1 /* bug-3523.c
2 Instructions that conditionally skip the following instruction were not considered correctly in the peephole optimizer.
3 */
5 #include <testfwk.h>
7 char c;
9 char f(void)
11 char a = c + 1;
12 if (a < 3)
13 return 1;
14 return a; // The ret got incorrectly optimized out for pdk.
17 void
18 testBug(void)
20 c = 3;
21 ASSERT (f() == 4);