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
PR middle-end/77357 - strlen of constant strings not folded
[official-gcc.git]
/
gcc
/
testsuite
/
gcc.c-torture
/
execute
/
pr45262.c
blob
45cc8de3c59a2a05aacf70bdce7e0581d800d2d6
1
/* PR middle-end/45262 */
2
3
/* { dg-require-effective-target int32plus } */
4
5
extern
void
abort
(
void
);
6
7
int
8
foo
(
unsigned int
x
)
9
{
10
return
((
int
)
x
<
0
) || ((
int
) (-
x
) <
0
);
11
}
12
13
int
14
bar
(
unsigned int
x
)
15
{
16
return
x
>>
31
|| (-
x
) >>
31
;
17
}
18
19
int
20
main
(
void
)
21
{
22
if
(
foo
(
1
) !=
1
)
23
abort
();
24
if
(
foo
(
0
) !=
0
)
25
abort
();
26
if
(
foo
(-
1
) !=
1
)
27
abort
();
28
if
(
bar
(
1
) !=
1
)
29
abort
();
30
if
(
bar
(
0
) !=
0
)
31
abort
();
32
if
(
bar
(-
1
) !=
1
)
33
abort
();
34
return
0
;
35
}