1 /* Copyright (C) 2004 Free Software Foundation.
2 
3    Check that constant folding of signbit, signbitf and signbitl math
4    functions doesn't break anything and produces the expected results.
5 
6    Written by Roger Sayle, 28th January 2004.  */
7 
8 /* { dg-do link } */
9 /* { dg-options "-O2" } */
10 
11 extern void link_error(void);
12 
13 extern int signbit(double);
14 extern int signbitf(float);
15 extern int signbitl(long double);
16 
main()17 int main()
18 {
19   if (signbit (1.0) != 0)
20     link_error ();
21   if (signbit (-2.0) == 0)
22     link_error ();
23 
24   if (signbitf (1.0f) != 0)
25     link_error ();
26   if (signbitf (-2.0f) == 0)
27     link_error ();
28 
29   if (signbitl (1.0l) != 0)
30     link_error ();
31   if (signbitl (-2.0f) == 0)
32     link_error ();
33 
34   return 0;
35 }
36 
37