2009-07-17 Richard Guenther <rguenther@suse.de>
[official-gcc.git] / gcc / testsuite / gcc.dg / builtins-65.c
blob91930c958808e940e6d109efd14fa4dee671d07e
1 /* { dg-do link } */
2 /* { dg-options "-O2 -ffast-math" } */
3 /* { dg-require-effective-target c99_runtime } */
5 extern int ilogbf (float);
6 extern float logbf (float);
7 extern int ilogb (double);
8 extern double logb (double);
9 extern int ilogbl (long double);
10 extern long double logbl (long double);
12 extern void link_error(void);
14 void testf(float x)
16 if ((int) logbf (x) != ilogbf (x))
17 link_error ();
20 void test(double x)
22 if ((int) logb (x) != ilogb (x))
23 link_error ();
26 void testl(long double x)
28 if ((int) logbl (x) != ilogbl (x))
29 link_error ();
32 int main()
34 testf (2.0f);
35 test (2.0);
36 testl (2.0l);
38 return 0;