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-930208-1.c
blob
61fcb2dacc801953763a225ede39ac17263845a6
1
/*
2
930208-1.c from the execute part of the gcc torture suite.
3
*/
4
5
#include <testfwk.h>
6
7
#ifdef __SDCC
8
#pragma std_c99
9
#endif
10
11
// TODO: Enable when sdcc supports union!
12
#if 0
13
typedef
union
{
14
long
l
;
15
struct
{
char
b3
,
b2
,
b1
,
b0
; }
c
;
16
}
T
;
17
18
f
(
T u
)
19
{
20
++
u
.
c
.
b0
;
21
++
u
.
c
.
b3
;
22
return
(
u
.
c
.
b1
!=
2
||
u
.
c
.
b2
!=
2
);
23
}
24
#endif
25
26
void
27
testTortureExecute
(
void
)
28
{
29
#if 0
30
T u
;
31
u
.
c
.
b1
=
2
;
32
u
.
c
.
b2
=
2
;
33
u
.
c
.
b0
= ~
0
;
34
u
.
c
.
b3
= ~
0
;
35
if
(
f
(
u
))
36
ASSERT
(
0
);
37
return
;
38
#endif
39
}
40