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-20070212-3.c
blob
6274dffa50d2520c9b0e448656c19c49f05b9b90
1
/*
2
20070212-3.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
struct
foo
{
int
i
;
int
j
; };
12
13
int
bar
(
struct
foo
*
k
,
int
k2
,
int
f
,
int
f2
)
14
{
15
int
*
p
, *
q
;
16
int
res
;
17
if
(
f
)
18
p
= &
k
->
i
;
19
else
20
p
= &
k
->
j
;
21
res
= *
p
;
22
k
->
i
=
1
;
23
if
(
f2
)
24
q
=
p
;
25
else
26
q
= &
k2
;
27
return
res
+ *
q
;
28
}
29
30
void
31
testTortureExecute
(
void
)
32
{
33
struct
foo k
;
34
k
.
i
=
0
;
35
k
.
j
=
1
;
36
if
(
bar
(&
k
,
1
,
1
,
1
) !=
1
)
37
ASSERT
(
0
);
38
return
;
39
}