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
/
bug3130806.c
blob
f5699edfd07516b37ad0ed57d76ce7a5505f88f9
1
/*
2
bug3130806.c
3
*/
4
5
#include <testfwk.h>
6
7
char
foo
[
2
];
8
9
void
blah
(
char
*
m0
,
void
*
m1
)
10
{
11
*
m0
=
1
;
12
m1
;
13
}
14
15
void
dostuff
(
unsigned char
*
buffer
,
unsigned char
size
)
16
{
17
unsigned char
x
=
0
;
18
unsigned char
y
=
0
;
19
20
while
(
x
<
1
)
21
{
22
y
= (
size
-
x
);
23
24
if
(
y
==
2
)
25
return
;
26
27
blah
(&
foo
[
x
], &
buffer
[
y
]);
28
29
x
+=
y
;
30
}
31
}
32
33
void
testBug
(
void
)
34
{
35
unsigned char
buffer
[
2
];
36
dostuff
(
buffer
,
2
);
37
ASSERT
(
foo
[
0
] ==
0
);
38
}