2008-03-21 Janne Blomqvist <jb@gcc.gnu.org>
[official-gcc.git] / gcc / testsuite / gcc.dg / builtins-19.c
blobf0583a9783b7f145bbda4ea00984cf8938a3b9e9
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);
13 double fabs (double);
14 float fabsf (float);
15 long double fabsl (long double);
17 void link_error (void);
19 void test (double x)
21 if (cabs (x) != fabs (x))
22 link_error ();
25 void testf (float x)
27 if (cabsf (x) != fabsf (x))
28 link_error ();
31 void testl (long double x)
33 if (cabsl (x) != fabsl (x))
34 link_error ();
37 int main ()
39 test (1.0);
40 testf (1.0f);
41 testl (1.0l);
42 return 0;