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
Pick three bugfixes from next branch to trunk for inclusion in 4.5.0 RC2, as discusse...
[sdcc.git]
/
sdcc
/
support
/
regression
/
tests
/
gcc-torture-execute-pta-field-2.c
blob
ef4064aaf3246082950886ae56ec1c22a6006c40
1
/*
2
pta-field-2.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
Foo
{
12
int
*
p
;
13
int
*
q
;
14
};
15
16
void
17
bar
(
int
**
x
)
18
{
19
struct
Foo
*
f
= (
struct
Foo
*)(
x
-
1
);
20
*(
f
->
p
) =
0
;
21
}
22
23
int
foo
(
void
)
24
{
25
struct
Foo f
;
26
int
i
=
1
,
j
=
2
;
27
f
.
p
= &
i
;
28
f
.
q
= &
j
;
29
bar
(&
f
.
q
);
30
return
i
;
31
}
32
33
void
34
testTortureExecute
(
void
)
35
{
36
if
(
foo
() !=
0
)
37
ASSERT
(
0
);
38
return
;
39
}
40