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.c-torture
/
execute
/
pr56799.c
blob
d9ee26bc27fc2e78a6faac0d3e4635e61985617a
1
2
#include <stdio.h>
3
typedef
struct
{
int
x
;
int
y
;}
S
;
4
extern
int
foo
(
S
*);
5
int
hi
=
0
,
lo
=
0
;
6
7
int
main
()
8
{
9
S a
;
10
int
r
;
11
a
.
x
= (
int
)
0x00010000
;
12
a
.
y
=
1
;
13
r
=
foo
(&
a
);
14
if
(
r
==
2
&&
lo
==
0
&&
hi
==
1
)
15
{
16
exit
(
0
);
17
}
18
abort
();
19
}
20
21
typedef
unsigned short
u16
;
22
23
__attribute__
((
noinline
))
int
foo
(
S
*
ptr
)
24
{
25
int
a
=
ptr
->
x
;
26
int
c
=
0
;
27
u16 b
= (
u16
)
a
;
28
if
(
b
!=
0
)
29
{
30
lo
=
1
;
31
c
+=
ptr
->
y
;
32
}
33
b
=
a
>>
16
;
34
if
(
b
!=
0
)
35
{
36
hi
=
1
;
37
c
+=
ptr
->
y
;
38
}
39
c
+=
ptr
->
y
;
40
return
c
;
41
}
42
43