2018-04-09 Richard Biener <rguenther@suse.de>
[official-gcc.git] / gcc / testsuite / gcc.dg / unordered-3.c
blobd08abd0ca03f46003d28cde377c9da69615f7219
1 /* { dg-do link } */
2 /* { dg-options "-fno-finite-math-only" } */
4 void link_error ();
6 void test1()
8 if (__builtin_isgreater(1.0,__builtin_nan("")) != 0)
9 link_error ();
10 if (__builtin_isgreater(__builtin_nan(""),1.0) != 0)
11 link_error ();
13 if (__builtin_isgreaterequal(1.0,__builtin_nan("")) != 0)
14 link_error ();
15 if (__builtin_isgreaterequal(__builtin_nan(""),1.0) != 0)
16 link_error ();
18 if (__builtin_isless(1.0,__builtin_nan("")) != 0)
19 link_error ();
20 if (__builtin_isless(__builtin_nan(""),1.0) != 0)
21 link_error ();
23 if (__builtin_islessequal(1.0,__builtin_nan("")) != 0)
24 link_error ();
25 if (__builtin_islessequal(__builtin_nan(""),1.0) != 0)
26 link_error ();
28 if (__builtin_islessgreater(1.0,__builtin_nan("")) != 0)
29 link_error ();
30 if (__builtin_islessgreater(__builtin_nan(""),1.0) != 0)
31 link_error ();
33 if (__builtin_isunordered(1.0,__builtin_nan("")) == 0)
34 link_error ();
35 if (__builtin_isunordered(__builtin_nan(""),1.0) == 0)
36 link_error ();
40 void test2(double x)
42 if (__builtin_isgreater(x,__builtin_nan("")) != 0)
43 link_error ();
44 if (__builtin_isgreater(__builtin_nan(""),x) != 0)
45 link_error ();
47 if (__builtin_isgreaterequal(x,__builtin_nan("")) != 0)
48 link_error ();
49 if (__builtin_isgreaterequal(__builtin_nan(""),x) != 0)
50 link_error ();
52 if (__builtin_isless(x,__builtin_nan("")) != 0)
53 link_error ();
54 if (__builtin_isless(__builtin_nan(""),x) != 0)
55 link_error ();
57 if (__builtin_islessequal(x,__builtin_nan("")) != 0)
58 link_error ();
59 if (__builtin_islessequal(__builtin_nan(""),x) != 0)
60 link_error ();
62 if (__builtin_islessgreater(x,__builtin_nan("")) != 0)
63 link_error ();
64 if (__builtin_islessgreater(__builtin_nan(""),x) != 0)
65 link_error ();
67 if (__builtin_isunordered(x,__builtin_nan("")) == 0)
68 link_error ();
69 if (__builtin_isunordered(__builtin_nan(""),x) == 0)
70 link_error ();
74 int main()
76 test1 ();
77 test2 (1.0);
78 return 0;