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-2825.c
blob
e62ad5561b8629d4d4dd2c13c1114c9c17a1a478
1
/*
2
bug-2825.c a bug in s08 code generation that overwrote a in left shifts of 32-bit values by literals in the range [3,7];
3
*/
4
5
#include <testfwk.h>
6
7
unsigned char
c
;
8
unsigned long
l
;
9
10
void
f
(
void
)
11
{
12
unsigned char
t
=
c
+
1
;
// t allocated to a
13
14
l
<<=
6
;
// Overwrites a.
15
16
if
(
t
!=
1
)
17
f
();
18
}
19
20
void
testBug
(
void
)
21
{
22
c
=
0
;
23
l
=
1
;
24
f
();
25
26
ASSERT
(
l
==
1ul
<<
6
);
27
}
28