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