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
/
gcc-torture-execute-pr41317.c
blob
5da50d5af541433e3aa4e101c0032c02870045de
1
/*
2
pr41317.c from the execute part of the gcc torture tests.
3
*/
4
5
#include <testfwk.h>
6
7
#ifdef __SDCC
8
#pragma std_c99
9
#endif
10
11
struct
A
12
{
13
int
i
;
14
};
15
struct
B
16
{
17
struct
A a
;
18
int
j
;
19
};
20
21
static void
22
foo
(
struct
B
*
p
)
23
{
24
((
struct
A
*)
p
)->
i
=
1
;
25
}
26
27
void
28
testTortureExecute
(
void
)
29
{
30
struct
A a
;
31
a
.
i
=
0
;
32
foo
((
struct
B
*)&
a
);
33
if
(
a
.
i
!=
1
)
34
ASSERT
(
0
);
35
return
;
36
}
37