| 1 |
/* { dg-do run } */ |
| 2 |
/* { dg-options "-save-temps -O2 -fno-inline" } */ |
| 3 |
|
| 4 |
extern void abort (void); |
| 5 |
|
| 6 |
int |
| 7 |
foosi (int x) |
| 8 |
{ |
| 9 |
return x > 100 ? x - 2 : x - 1; |
| 10 |
} |
| 11 |
|
| 12 |
int |
| 13 |
barsi (int x) |
| 14 |
{ |
| 15 |
return x > 100 ? x + 4 : x + 3; |
| 16 |
} |
| 17 |
|
| 18 |
long long |
| 19 |
foodi (long long x) |
| 20 |
{ |
| 21 |
return x > 100 ? x - 2 : x - 1; |
| 22 |
} |
| 23 |
|
| 24 |
long long |
| 25 |
bardi (long long x) |
| 26 |
{ |
| 27 |
return x > 100 ? x + 4 : x + 3; |
| 28 |
} |
| 29 |
|
| 30 |
/* { dg-final { scan-assembler-times "cs?inc\tw\[0-9\]*" 2 } } */ |
| 31 |
/* { dg-final { scan-assembler-times "cs?inc\tx\[0-9\]*" 2 } } */ |
| 32 |
|
| 33 |
int |
| 34 |
main (void) |
| 35 |
{ |
| 36 |
if (foosi (105) != 103) |
| 37 |
abort (); |
| 38 |
|
| 39 |
if (foosi (95) != 94) |
| 40 |
abort (); |
| 41 |
|
| 42 |
if (barsi (105) != 109) |
| 43 |
abort (); |
| 44 |
|
| 45 |
if (barsi (95) != 98) |
| 46 |
abort (); |
| 47 |
|
| 48 |
if (foodi (105) != 103) |
| 49 |
abort (); |
| 50 |
|
| 51 |
if (foodi (95) != 94) |
| 52 |
abort (); |
| 53 |
|
| 54 |
if (bardi (105) != 109) |
| 55 |
abort (); |
| 56 |
|
| 57 |
if (bardi (95) != 98) |
| 58 |
abort (); |
| 59 |
|
| 60 |
return 0; |
| 61 |
} |
| 62 |
|
| 63 |
/* { dg-final { scan-assembler-not "csel\tx\[0-9\]*.*" } } */ |
| 64 |
/* { dg-final { scan-assembler-not "csel\tw\[0-9\]*.*" } } */ |