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
/
bug1409955.c
blob
8d07e487c1c06a88e4a1db0bb8a0aa1d4b7cca61
1
/*
2
bug1409955.c
3
*/
4
5
#include <testfwk.h>
6
7
void
8
WriteToXData
(
char
*
buffer
)
9
{
10
(
void
)
buffer
;
11
}
12
13
void
14
test_push_pop
(
void
)
15
{
16
char
a
;
17
__xdata
char
*
p
;
18
char
d
[
5
];
19
20
d
[
0
] =
0
;
21
d
[
1
] =
0
;
22
d
[
2
] =
0
;
23
d
[
3
] =
0
;
24
d
[
4
] =
0
;
25
p
=
0
;
26
do
27
{
28
if
((
unsigned short
)
p
>
10
)
29
a
=
10
- (
char
)
p
;
30
else
31
a
=
60
;
32
d
[
0
] =
0x12
;
33
d
[
1
] =
0x34
;
34
WriteToXData
(
d
);
// Watch the xdata: 0, 1!
35
p
+=
a
;
36
ASSERT
(
d
[
0
] ==
0x12
);
37
ASSERT
(
d
[
1
] ==
0x34
);
38
}
39
while
(!
p
);
40
d
[
0
] =
1
;
41
d
[
1
] =
2
;
42
d
[
2
] =
3
;
43
d
[
3
] =
4
;
44
d
[
4
] =
5
;
45
}