Reverting merge from trunk
[official-gcc.git] / gcc / testsuite / gcc.dg / builtins-31.c
blob6e1bda0b7ba14a497d2cbcd2a488c159fbbc4708
1 /* Copyright (C) 2004 Free Software Foundation.
3 Check that constant folding of signbit, signbitf and signbitl math
4 functions doesn't break anything and produces the expected results.
6 Written by Roger Sayle, 28th January 2004. */
8 /* { dg-do link } */
9 /* { dg-options "-O2" } */
11 extern void link_error(void);
13 extern int signbit(double);
14 extern int signbitf(float);
15 extern int signbitl(long double);
17 int main()
19 if (signbit (1.0) != 0)
20 link_error ();
21 if (signbit (-2.0) == 0)
22 link_error ();
24 if (signbitf (1.0f) != 0)
25 link_error ();
26 if (signbitf (-2.0f) == 0)
27 link_error ();
29 if (signbitl (1.0l) != 0)
30 link_error ();
31 if (signbitl (-2.0f) == 0)
32 link_error ();
34 return 0;