repo.or.cz
/
sdcc.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
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
blob
8233119f931218635e641e4c15af48ea2087c3a4
1
/* bug-3661.c
2
An issue in arithmetic in the Rabbit assembler.
3
*/
4
5
#include <testfwk.h>
6
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
)
9
{
10
__asm
11
ld a
,
#(0x8000 >> 15)
12
ret
13
__endasm
;
14
}
15
#else
16
unsigned char
f
(
void
)
17
{
18
return
(
1
);
19
}
20
#endif
21
22
void
23
testBug
(
void
)
24
{
25
ASSERT
(
f
() ==
1
);
26
}
27