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-2306.c
blob
84a67242668f906e511e79df8668c3fd727f0791
1
/*
2
bug-2306.c frame pointer omission triggered a code generation bug in 16-bit addition short functions.
3
*/
4
5
#include <testfwk.h>
6
7
int
add
(
int
pa
,
int
pb
)
8
{
9
return
pa
*
2
+
pb
;
10
}
11
12
void
testBug
(
void
)
13
{
14
ASSERT
(
add
(
0x0023
,
0x0042
) ==
0x0023
*
2
+
0x0042
);
15
ASSERT
(
add
(
0x2300
,
0x4200
) ==
0x2300
*
2
+
0x4200
);
16
}
17