No empty .Rs/.Re
[netbsd-mini2440.git] / gnu / dist / gcc4 / gcc / testsuite / gcc.dg / builtins-55.c
blobd804f290e008d356ae2a58aebeb54f2fee51478b
1 /* { dg-do link } */
2 /* { dg-options "-O2 -ffast-math" } */
3 /* { dg-options "-ffast-math -mmacosx-version-min=10.3" { target powerpc-*-darwin* } } */
4 /* { dg-options "-O2 -ffast-math -std=c99" { target *-*-solaris2* } } */
6 #include "builtins-config.h"
8 void link_error (void);
10 extern long lround(double);
11 extern long lrint(double);
13 extern long long llround(double);
14 extern long long llrint(double);
16 extern long lroundf(float);
17 extern long lrintf(float);
19 extern long long llroundf(float);
20 extern long long llrintf(float);
22 extern long lroundl(long double);
23 extern long lrintl(long double);
25 extern long long llroundl(long double);
26 extern long long llrintl(long double);
29 void test(double x)
31 #ifdef HAVE_C99_RUNTIME
32 if (sizeof(long) != sizeof(long long))
33 return;
35 if (lround(x) != llround(x))
36 link_error();
37 if (lrint(x) != llrint(x))
38 link_error();
39 #endif
42 void testf(float x)
44 #ifdef HAVE_C99_RUNTIME
45 if (sizeof(long) != sizeof(long long))
46 return;
48 if (lroundf(x) != llroundf(x))
49 link_error();
50 if (lrintf(x) != llrintf(x))
51 link_error();
52 #endif
55 void testl(long double x)
57 #ifdef HAVE_C99_RUNTIME
58 if (sizeof(long) != sizeof(long long))
59 return;
61 if (lroundl(x) != llroundl(x))
62 link_error();
63 if (lrintl(x) != llrintl(x))
64 link_error();
65 #endif
68 int main()
70 test(0.0);
71 testf(0.0);
72 testl(0.0);
73 return 0;