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-227710.c
blob
013ddea84fba74ab55ef370b480b3ddeb2cc4557
1
/* bug-227710.c
2
*/
3
#include <testfwk.h>
4
5
static unsigned char
dataset
[] = {
6
1
,
2
,
3
,
4
7
};
8
9
unsigned char
*
p
;
10
11
struct
{
12
unsigned char
index
;
13
}
s
;
14
15
unsigned char
16
foo
(
void
)
17
{
18
// BUG, there will be a PRE-increment
19
return
p
[
s
.
index
++];
20
}
21
22
void
23
testPostIncrement
(
void
)
24
{
25
p
=
dataset
;
26
ASSERT
(
foo
() ==
1
);
27
ASSERT
(
foo
() ==
2
);
28
ASSERT
(
foo
() ==
3
);
29
ASSERT
(
foo
() ==
4
);
30
}