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
struct / union in initializer, RFE #901.
[sdcc.git]
/
sdcc
/
support
/
regression
/
tests
/
bug-3085.c
blob
05737462091f5bb9742d81c6990a211b280ee19f
1
/* bug-3085.c
2
Pdk code generation for wide < overwrote upper byte of operand in p.
3
*/
4
5
#include <testfwk.h>
6
7
#include <stdint.h>
8
9
uint16_t
f
(
void
)
10
{
11
uint16_t
cc
=
0
;
12
for
(
uint16_t
j
=
0
;
j
<
500
;
j
++) {
// Code generation for upper byte for < overwrote upper byte of j.
13
cc
++;
14
}
15
16
cc
= ~
cc
;
17
18
return
cc
;
19
}
20
21
void
22
testBug
(
void
)
23
{
24
ASSERT
(
f
() == (
uint16_t
)(~(
uint16_t
)
500
));
25
}
26