| 1 |
/* Check that conversion functions link correctly with -ffast-math. */ |
| 2 |
|
| 3 |
/* { dg-do link } */ |
| 4 |
/* { dg-options "-ffast-math -lm" } */ |
| 5 |
/* Bionic doesn't have rintl */ |
| 6 |
/* { dg-require-effective-target non_bionic } */ |
| 7 |
|
| 8 |
#include "builtins-config.h" |
| 9 |
|
| 10 |
double floor (double); |
| 11 |
float floorf (float); |
| 12 |
long double floorl (long double); |
| 13 |
|
| 14 |
double ceil (double); |
| 15 |
float ceilf (float); |
| 16 |
long double ceill (long double); |
| 17 |
|
| 18 |
double round (double); |
| 19 |
float roundf (float); |
| 20 |
long double roundl (long double); |
| 21 |
|
| 22 |
double rint (double); |
| 23 |
float rintf (float); |
| 24 |
long double rintl (long double); |
| 25 |
|
| 26 |
int ifloor (double a) { return (int) floor (a); } |
| 27 |
#ifdef HAVE_C99_RUNTIME |
| 28 |
int ifloorf (float a) { return (int) floorf (a); } |
| 29 |
int ifloorl (long double a) { return (int) floorl (a); } |
| 30 |
#endif |
| 31 |
|
| 32 |
long lfloor (double a) { return (long) floor (a); } |
| 33 |
#ifdef HAVE_C99_RUNTIME |
| 34 |
long lfloorf (float a) { return (long) floorf (a); } |
| 35 |
long lfloorl (long double a) { return (long) floorl (a); } |
| 36 |
#endif |
| 37 |
|
| 38 |
long long llfloor (double a) { return (long long) floor (a); } |
| 39 |
#ifdef HAVE_C99_RUNTIME |
| 40 |
long long llfloorf (float a) { return (long long) floorf (a); } |
| 41 |
long long llfloorl (long double a) { return (long long) floorl (a); } |
| 42 |
#endif |
| 43 |
|
| 44 |
int iceil (double a) { return (int) ceil (a); } |
| 45 |
#ifdef HAVE_C99_RUNTIME |
| 46 |
int iceilf (float a) { return (int) ceilf (a); } |
| 47 |
int iceill (long double a) { return (int) ceill (a); } |
| 48 |
#endif |
| 49 |
|
| 50 |
long lceil (double a) { return (long) ceil (a); } |
| 51 |
#ifdef HAVE_C99_RUNTIME |
| 52 |
long lceilf (float a) { return (long) ceilf (a); } |
| 53 |
long lceill (long double a) { return (long) ceill (a); } |
| 54 |
#endif |
| 55 |
|
| 56 |
long long llceil (double a) { return (long long) ceil (a); } |
| 57 |
#ifdef HAVE_C99_RUNTIME |
| 58 |
long long llceilf (float a) { return (long long) ceilf (a); } |
| 59 |
long long llceill (long double a) { return (long long) ceill (a); } |
| 60 |
#endif |
| 61 |
|
| 62 |
#ifdef HAVE_C99_RUNTIME |
| 63 |
int iround (double a) { return (int) round (a); } |
| 64 |
int iroundf (float a) { return (int) roundf (a); } |
| 65 |
int iroundl (long double a) { return (int) roundl (a); } |
| 66 |
#endif |
| 67 |
|
| 68 |
#ifdef HAVE_C99_RUNTIME |
| 69 |
int irint (double a) { return (int) rint (a); } |
| 70 |
int irintf (float a) { return (int) rintf (a); } |
| 71 |
int irintl (long double a) { return (int) rintl (a); } |
| 72 |
#endif |
| 73 |
|
| 74 |
int main () { return 0; } |