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
/
qct
/
0051-inits.c
blob
face06463767e48c52f69cac40cd5b749f9238f5
1
2
struct
S1
{
3
int
a
;
4
int
b
;
5
};
6
7
struct
S2
{
8
int
a
;
9
int
b
;
10
union
{
11
int
c
;
12
int
d
;
13
};
14
struct
S1 s
;
15
};
16
17
struct
S2 v
= {
1
,
2
,
3
, {
4
,
5
}};
18
19
int
20
main
()
21
{
22
if
(
v
.
a
!=
1
)
23
return
1
;
24
if
(
v
.
b
!=
2
)
25
return
2
;
26
if
(
v
.
c
!=
3
||
v
.
d
!=
3
)
27
return
3
;
28
if
(
v
.
s
.
a
!=
4
)
29
return
4
;
30
if
(
v
.
s
.
b
!=
5
)
31
return
5
;
32
33
return
0
;
34
}