Pick three bugfixes from next branch to trunk for inclusion in 4.5.0 RC2, as discusse...
[sdcc.git] / sdcc / support / regression / tests / bug2094505.c
blobb9b931c6d74deb76f564701453a9650a680a8e01
1 /*
2 bug 2094505
3 */
5 #include <testfwk.h>
7 void
8 testBug(void)
10 #if !defined(__SDCC_mcs51) && !(defined(__SDCC_MODEL_LARGE) && !defined(__SDCC_STACK_AUTO)) && !defined(__SDCC_pdk14) && !defined(__SDCC_pdk15) && !defined(__SDCC_pic14) // Lack of memory
11 // varA has to be declared for the bug to manifest itself
12 #if defined(__SDCC_STACK_AUTO)
13 volatile char varA[64] = {0};
14 #else
15 volatile char varA[256] = {0};
16 #endif
17 volatile unsigned int varB = 0x1;
18 volatile unsigned short varC = 0x2;
20 // The Less Than comparison ASM for this while loop is generated incorrectly.
21 ASSERT (varB < varC);
22 #endif