Fix broken MinGW build of gcc.c
[official-gcc.git] / gcc / testsuite / gcc.dg / builtins-46.c
blob3a955a56929c097e725ec09a1904df3dee81e7a0
1 /* Copyright (C) 2004 Free Software Foundation.
3 Check that rint, rintf, rintl, lrint, lrintf, lrintl,
4 llrint, llrintf, llrintl, floor, floorf, floorl,
5 ceil, ceilf, ceill, trunc, truncf, truncl,
6 nearbyint, nearbyintf and nearbyintl
7 built-in functions compile.
9 Written by Uros Bizjak, 25th Aug 2004. */
11 /* { dg-do compile } */
12 /* { dg-options "-O2 -ffast-math" } */
14 extern double rint(double);
15 extern long int lrint(double);
16 extern long long int llrint(double);
17 extern double floor(double);
18 extern double ceil(double);
19 extern double trunc(double);
20 extern double nearbyint(double);
22 extern float rintf(float);
23 extern long int lrintf(float);
24 extern long long int llrintf(float);
25 extern float floorf(float);
26 extern float ceilf(float);
27 extern float truncf(float);
28 extern float nearbyintf(float);
30 extern long double rintl(long double);
31 extern long int lrintl(long double);
32 extern long long int llrintl(long double);
33 extern long double floorl(long double);
34 extern long double ceill(long double);
35 extern long double truncl(long double);
36 extern long double nearbyintl(long double);
39 double test1(double x)
41 return rint(x);
44 long int test11(double x)
46 return lrint(x);
49 long long int test12(double x)
51 return llrint(x);
54 double test2(double x)
56 return floor(x);
59 double test3(double x)
61 return ceil(x);
64 double test4(double x)
66 return trunc(x);
69 double test5(double x)
71 return nearbyint(x);
74 float test1f(float x)
76 return rintf(x);
79 long int test11f(float x)
81 return lrintf(x);
84 long long int test12f(float x)
86 return llrintf(x);
89 float test2f(float x)
91 return floorf(x);
94 float test3f(float x)
96 return ceilf(x);
99 float test4f(float x)
101 return truncf(x);
104 float test5f(float x)
106 return nearbyintf(x);
109 long double test1l(long double x)
111 return rintl(x);
114 long int test11l(long double x)
116 return lrintl(x);
119 long long int test12l(long double x)
121 return llrintl(x);
124 long double test2l(long double x)
126 return floorl(x);
129 long double test3l(long double x)
131 return ceill(x);
134 long double test4l(long double x)
136 return truncl(x);
139 long double test5l(long double x)
141 return nearbyintl(x);