2018-02-09 Sebastian Perta <sebastian.perta@renesas.com>
[official-gcc.git] / gcc / testsuite / gcc.target / sh / pr55303-2.c
blob4525790888a66dede86ce8d03e66bdd432675f17
1 /* Verify that for SH2A smax/smin -> cbranch conversion is done properly
2 if the clips insn is not used and the expected comparison insns are
3 generated. */
4 /* { dg-do compile { target { sh2a } } } */
5 /* { dg-options "-O2" } */
6 /* { dg-final { scan-assembler-times "cmp/pl" 4 } } */
8 int
9 test_00 (int a)
11 /* 1x cmp/pl */
12 return a >= 0 ? a : 0;
15 int
16 test_01 (int a)
18 /* 1x cmp/pl */
19 return a <= 0 ? a : 0;
22 int
23 test_02 (int a)
25 /* 1x cmp/pl */
26 return a < 1 ? 1 : a;
29 int
30 test_03 (int a)
32 /* 1x cmp/pl */
33 return a < 1 ? a : 1;