2003-12-26 Guilhem Lavaux <guilhem@kaffe.org>
[official-gcc.git] / gcc / testsuite / gcc.dg / builtins-19.c
bloba691f5eb97ddad0b96e763d6896dcd82c566b3ae
1 /* Copyright (C) 2003 Free Software Foundation.
3 Check that cabs of a non-complex argument is converted into fabs.
5 Written by Roger Sayle, 1st June 2003. */
7 /* { dg-do link } */
8 /* { dg-options "-O2 -ffast-math" } */
10 double cabs (__complex__ double);
11 float cabsf (__complex__ float);
12 long double cabsl (__complex__ long double);
14 void link_error (void);
16 void test (double x)
18 if (cabs (x) != fabs (x))
19 link_error ();
22 void testf (float x)
24 if (cabsf (x) != fabsf (x))
25 link_error ();
28 void testl (long double x)
30 if (cabsl (x) != fabsl (x))
31 link_error ();
34 int main ()
36 test (1.0);
37 testf (1.0f);
38 testl (1.0l);
39 return 0;