OSDN Git Service

* gcc.dg/20020201-1.c: Use cleanup-coverage_files.
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / gcc.dg / builtins-19.c
1 /* Copyright (C) 2003  Free Software Foundation.
2
3    Check that cabs of a non-complex argument is converted into fabs.
4
5    Written by Roger Sayle, 1st June 2003.  */
6
7 /* { dg-do link } */
8 /* { dg-options "-O2 -ffast-math" } */
9
10 double cabs (__complex__ double);
11 float cabsf (__complex__ float);
12 long double cabsl (__complex__ long double);
13 double fabs (double);
14 float fabsf (float);
15 long double fabsl (long double);
16
17 void link_error (void);
18
19 void test (double x)
20 {
21   if (cabs (x) != fabs (x))
22     link_error ();
23 }
24
25 void testf (float x)
26 {
27   if (cabsf (x) != fabsf (x))
28     link_error ();
29 }
30
31 void testl (long double x)
32 {
33   if (cabsl (x) != fabsl (x))
34     link_error ();
35 }
36
37 int main ()
38 {
39   test (1.0);
40   testf (1.0f);
41   testl (1.0l);
42   return 0;
43 }
44