| 1 |
/* { dg-do compile } */ |
| 2 |
/* { dg-require-effective-target ilp32 } */ |
| 3 |
/* { dg-options "-O3 -fno-math-errno -fno-fp-int-builtin-inexact" } */ |
| 4 |
|
| 5 |
#define TEST(name, float_type, int_type, fn) void f_##name (float_type x) \ |
| 6 |
{ \ |
| 7 |
volatile int_type b = __builtin_##fn (x); \ |
| 8 |
} |
| 9 |
|
| 10 |
TEST (dld, double, long, lrint) |
| 11 |
TEST (flf, float , long, lrintf) |
| 12 |
|
| 13 |
TEST (did, double, int, lrint) |
| 14 |
TEST (fif, float , int, lrintf) |
| 15 |
|
| 16 |
/* { dg-final { scan-assembler-times "fcvtzs\tw\[0-9\]+, \[d,s\]\[0-9\]+" 2 } } */ |
| 17 |
/* { dg-final { scan-assembler-times "bl\tlrint" 2 } } */ |