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
/
bug3559997.c
blob
56351715e762000fc0df32793a5bcde12653234f
1
/*
2
bug3559997.c
3
*/
4
5
#include <testfwk.h>
6
7
#pragma disable_warning 85
8
9
typedef
struct
10
{
11
long
i_size
;
12
}
s1_t
;
13
14
typedef
struct
{
15
s1_t s
;
16
}
i_t
, *
ip_t
;
17
18
typedef
struct
19
{
20
char
*
m3
;
21
long
m4
;
22
}
data_t
;
23
24
data_t data
;
25
26
void
f1
(
char
*
a
,
char
*
p
,
int
b
)
27
{
28
}
29
30
char
*
f2
(
int
a
,
int
b
,
char
c
)
31
{
32
return
(
0
);
33
}
34
35
int
f3
(
char
*
p
,
int
c
)
36
{
37
return
(
1
);
38
}
39
40
void
rx
(
ip_t i
)
41
{
42
char
*
bp
=
0
;
43
int
dev
=
0
;
44
45
46
bp
=
f2
(
dev
,
0
,
1
);
47
f1
(
data
.
m3
,
bp
,
1
);
48
if
(
f3
(
bp
,
2
) <
0
)
49
return
;
50
if
(
data
.
m4
>
i
->
s
.
i_size
)
51
i
->
s
.
i_size
=
data
.
m4
;
52
53
}
54
55
void
testBug
(
void
)
56
{
57
i_t i
;
58
data
.
m4
=
0xaa55
;
59
i
.
s
.
i_size
=
0x55aa
;
60
rx
(&
i
);
61
ASSERT
(
i
.
s
.
i_size
==
0xaa55
);
62
}
63