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-2929.c
blob
695df97d9f59d9799d2d3e4d43ece71df30d6d52
1
/*
2
bug-2929.c
3
4
A bug in z80 code generation for ~.
5
*/
6
7
#include <testfwk.h>
8
9
volatile
unsigned char
c
;
10
unsigned int
i
;
11
12
void
f
(
void
)
13
{
14
unsigned int
j
= (
unsigned char
)(
c
+
1
);
15
i
= ~
j
|
0xaa55
;
16
}
17
18
void
testBug
(
void
)
19
{
20
c
=
0xff
;
21
f
();
22
ASSERT
((
i
&
0xffff
u
) ==
0xffff
u
);
23
24
c
=
0x00
;
25
f
();
26
ASSERT
((
i
&
0xffff
u
) ==
0xffff
u
);
27
28
c
=
0xfe
;
29
f
();
30
ASSERT
((
i
&
0xffff
u
) ==
0xff55
u
);
31
}
32