1 /* Copyright (C) 2004 Free Software Foundation.
3 Check that constant folding of copysign, copysignf and copysignl math
4 functions doesn't break anything and produces the expected results.
6 Written by Roger Sayle, 6th June 2004. */
9 /* { dg-options "-O2" } */
11 extern void link_error(void);
13 extern double copysign(double, double);
14 extern float copysignf(float, float);
15 extern long double copysignl(long double, long double);
19 if (copysign (2.0, 1.0) != 2.0)
21 if (copysign (2.0, -1.0) != -2.0)
23 if (copysign (-2.0, 1.0) != 2.0)
25 if (copysign (-2.0, -1.0) != -2.0)
28 if (copysign (2.0, 1.0) != 2.0)
30 if (copysign (2.0, -1.0) != -2.0)
32 if (copysign (-2.0, 1.0) != 2.0)
34 if (copysign (-2.0, -1.0) != -2.0)
37 if (copysignf (2.0f
, 1.0f
) != 2.0f
)
39 if (copysignf (2.0f
, -1.0f
) != -2.0f
)
41 if (copysignf (-2.0f
, 1.0f
) != 2.0f
)
43 if (copysignf (-2.0f
, -1.0f
) != -2.0f
)
46 if (copysignl (2.0l, 1.0l) != 2.0l)
48 if (copysignl (2.0l, -1.0l) != -2.0l)
50 if (copysignl (-2.0l, 1.0l) != 2.0l)
52 if (copysignl (-2.0l, -1.0l) != -2.0l)