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-930718-1.c
blob
dcaa14bab41c47de67a688e5add95ffbe2a2a8e7
1
/*
2
930718-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
typedef
struct
rtx_def
12
{
13
int
f1
:
1
;
14
int
f2
:
1
;
15
} *
rtx
;
16
17
static
rtx
18
f
(
register
rtx orig
)
19
{
20
if
(
orig
->
f1
||
orig
->
f2
)
21
return
orig
;
22
orig
->
f2
=
1
;
23
return
orig
;
24
}
25
26
void
27
f2
()
28
{
29
ASSERT
(
0
);
30
}
31
32
void
33
testTortureExecute
(
void
)
34
{
35
struct
rtx_def foo
;
36
rtx bar
;
37
38
foo
.
f1
=
1
;
39
foo
.
f2
=
0
;
40
bar
=
f
(&
foo
);
41
if
(
bar
!= &
foo
||
bar
->
f2
!=
0
)
42
ASSERT
(
0
);
43
return
;
44
}
45