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-2643.c
blob
14f6bba55b820a3fa6f1b0e939fa4ed93bb54f4a
1
/*
2
bug-2643.c
3
*/
4
5
#include <testfwk.h>
6
7
struct
S
{
int
a
;
union
{
int
b
;
int
c
; }; };
8
9
struct
S x
= {
1
, {
2
} };
10
struct
S y
= {
5
, {
6
} };
11
struct
S z
= {
7
, { .
c
=
8
} };
12
13
void
testBug
(
void
)
14
{
15
ASSERT
(
x
.
a
==
1
);
16
ASSERT
(
x
.
b
==
2
);
17
ASSERT
(
y
.
a
==
5
);
18
ASSERT
(
y
.
b
==
6
);
19
ASSERT
(
z
.
a
==
7
);
20
ASSERT
(
z
.
c
==
8
);
21
}
22