blob: 4525790888a66dede86ce8d03e66bdd432675f17 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
|
/* Verify that for SH2A smax/smin -> cbranch conversion is done properly
if the clips insn is not used and the expected comparison insns are
generated. */
/* { dg-do compile { target { sh2a } } } */
/* { dg-options "-O2" } */
/* { dg-final { scan-assembler-times "cmp/pl" 4 } } */
int
test_00 (int a)
{
/* 1x cmp/pl */
return a >= 0 ? a : 0;
}
int
test_01 (int a)
{
/* 1x cmp/pl */
return a <= 0 ? a : 0;
}
int
test_02 (int a)
{
/* 1x cmp/pl */
return a < 1 ? 1 : a;
}
int
test_03 (int a)
{
/* 1x cmp/pl */
return a < 1 ? a : 1;
}
|