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-20030913-1.c
blob
aa23575a6088ce5d88fd09674dd6a3013688fc02
1
/*
2
20030913-1.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
/* Assignments via pointers pointing to global variables were being killed
12
by SSA-DCE. Test contributed by Paul Brook <paul@nowt.org> */
13
14
int
globl
;
15
16
void
17
fn2
(
int
**
q
)
18
{
19
*
q
= &
globl
;
20
}
21
22
void
foo
(
void
)
23
{
24
int
*
p
;
25
26
fn2
(&
p
);
27
28
*
p
=
42
;
29
}
30
31
void
32
testTortureExecute
(
void
)
33
{
34
foo
();
35
ASSERT
(
globl
==
42
);
36
return
;
37
}