repo.or.cz
/
official-gcc.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
gcc/
[official-gcc.git]
/
gcc
/
testsuite
/
gcc.dg
/
pr20115.c
blob
cea4b486854f239eff9bcdbbf17ec6e49997df89
1
/* { dg-do run } */
2
/* { dg-options "-O2" } */
3
4
int
func_pure
(
void
);
5
void
func_other
(
int
);
6
int
global_int
;
7
int
func_pure
(
void
) {
return
global_int
; }
8
void
func_other
(
int
a
)
9
{
10
global_int
=
a
+
1
;
11
}
12
int
f
(
void
)
13
{
14
int
a
;
15
a
=
func_pure
();
16
func_other
(
a
);
17
a
=
func_pure
();
// We were removing this function call
18
return
a
;
19
}
20
void
abort
(
void
);
21
22
int
main
(
void
)
23
{
24
global_int
=
10
;
25
if
(
f
() !=
11
)
26
abort
();
27
return
0
;
28
}