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