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
/
bug-2646174.c
blob
4851a7bad76cce96fde288be3db711acc779f647
1
/*
2
bug-2646174.c
3
*/
4
5
#include <testfwk.h>
6
7
#include <string.h>
8
9
struct
foo1
10
{
11
int
x
;
12
int
y
;
13
};
14
15
struct
foo2
16
{
17
struct
foo1 base_position
;
18
struct
foo1 direction
;
19
};
20
21
void
22
f
(
struct
foo1
*
a
,
const struct
foo2
*
d
)
23
{
24
memcpy
(
a
, &(
d
->
direction
),
sizeof
(
struct
foo1
));
25
}
26
27
void
28
test_2646174
(
void
)
29
{
30
struct
foo2 x
;
31
struct
foo1 y
;
32
y
.
x
=
0
;
33
x
.
direction
.
x
=
1
;
34
f
(&
y
, &
x
);
35
ASSERT
(
y
.
x
==
1
);
36
}
37