| 1 |
/* { dg-do run } */ |
| 2 |
/* Check that find_scan_insn properly handles swapped FP comparisons. */ |
| 3 |
static double x; |
| 4 |
static int exit_code; |
| 5 |
|
| 6 |
void __attribute__ ((noinline)) |
| 7 |
check_int (int a, int b) |
| 8 |
{ |
| 9 |
exit_code += (a != b); |
| 10 |
} |
| 11 |
|
| 12 |
int |
| 13 |
main (void) |
| 14 |
{ |
| 15 |
x = 0.0; |
| 16 |
asm ("" : "+m" (x)); |
| 17 |
check_int (__builtin_isgreater (x, 1.0), 0); |
| 18 |
check_int (__builtin_isgreaterequal (x, 1.0), 0); |
| 19 |
check_int (__builtin_isless (x, 1.0), 1); |
| 20 |
check_int (__builtin_islessequal (x, 1.0), 1); |
| 21 |
check_int (__builtin_islessgreater (x, 1.0), 1); |
| 22 |
return exit_code; |
| 23 |
} |