Pick three bugfixes from next branch to trunk for inclusion in 4.5.0 RC2, as discusse...
[sdcc.git] / sdcc / support / regression / tests / bug-3661.c
blob8233119f931218635e641e4c15af48ea2087c3a4
1 /* bug-3661.c
2 An issue in arithmetic in the Rabbit assembler.
3 */
5 #include <testfwk.h>
7 #if defined(__SDCC_z80) || defined(__SDCC_z180) || defined(__SDCC_r2k) || defined(__SDCC_r2ka) || defined(__SDCC_r3ka) || defined(__SDCC_sm83)
8 unsigned char f(void) __naked __sdcccall(1)
10 __asm
11 ld a, #(0x8000 >> 15)
12 ret
13 __endasm;
15 #else
16 unsigned char f(void)
18 return(1);
20 #endif
22 void
23 testBug (void)
25 ASSERT (f() == 1);