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
* expmed.c (flip_storage_order): Deal with complex modes specially.
[official-gcc.git]
/
gcc
/
testsuite
/
gcc.c-torture
/
execute
/
20080522-1.c
blob
75bc533f557f6425760c5d813551910e7d654b3a
1
/* This testcase is to make sure we have i in referenced vars and that we
2
properly compute aliasing for the loads and stores. */
3
4
extern
void
abort
(
void
);
5
6
static int
i
;
7
static int
*
p
= &
i
;
8
9
int
__attribute__
((
noinline
))
10
foo
(
int
*
q
)
11
{
12
*
p
=
1
;
13
*
q
=
2
;
14
return
*
p
;
15
}
16
17
int
__attribute__
((
noinline
))
18
bar
(
int
*
q
)
19
{
20
*
q
=
2
;
21
*
p
=
1
;
22
return
*
q
;
23
}
24
25
int
main
()
26
{
27
int
j
=
0
;
28
29
if
(
foo
(&
i
) !=
2
)
30
abort
();
31
if
(
bar
(&
i
) !=
1
)
32
abort
();
33
if
(
foo
(&
j
) !=
1
)
34
abort
();
35
if
(
j
!=
2
)
36
abort
();
37
if
(
bar
(&
j
) !=
2
)
38
abort
();
39
if
(
j
!=
2
)
40
abort
();
41
42
return
0
;
43
}