Pick three bugfixes from next branch to trunk for inclusion in 4.5.0 RC2, as discusse...
[sdcc.git] / sdcc / support / regression / tests / bug-3002.c
blob6441fed8687290e5d84e6b5b691786cd8eb9121c
1 /*
2 bug-3002.c - a bug in stm8 code generation for right shifts.
3 */
5 #include <testfwk.h>
7 #include <stdint.h>
9 uint_least32_t f(uint_least32_t arg)
11 return((arg >> 22) | 0x15000000); // Operands chosen to encourage allocation of upper byte of shift result in accumulator and use of div for shift.
13 void testBug(void)
15 ASSERT(f(0xaaa00000) == 0x150002aa);