2018-06-05 Richard Biener <rguenther@suse.de>
[official-gcc.git] / gcc / testsuite / gcc.dg / pr28796-1.c
blob077118a298878441e812410f3a6bf3707fb1d839
1 /* { dg-do link } */
2 /* { dg-options "-ffinite-math-only" } */
4 extern void link_error(void);
6 float f;
7 double d;
8 long double ld;
10 int main()
12 if (__builtin_isunordered (f, f) != 0)
13 link_error ();
14 if (__builtin_isunordered (d, d) != 0)
15 link_error ();
16 if (__builtin_isunordered (ld, ld) != 0)
17 link_error ();
19 if (__builtin_isnan (f) != 0)
20 link_error ();
21 if (__builtin_isnan (d) != 0)
22 link_error ();
23 if (__builtin_isnan (ld) != 0)
24 link_error ();
25 if (__builtin_isnanf (f) != 0)
26 link_error ();
27 if (__builtin_isnanl (ld) != 0)
28 link_error ();
30 if (__builtin_finite (f) != 1)
31 link_error ();
32 if (__builtin_finite (d) != 1)
33 link_error ();
34 if (__builtin_finite (ld) != 1)
35 link_error ();
36 if (__builtin_finitef (f) != 1)
37 link_error ();
38 if (__builtin_finitel (ld) != 1)
39 link_error ();
41 if (__builtin_isinf (f) != 0)
42 link_error ();
43 if (__builtin_isinf (d) != 0)
44 link_error ();
45 if (__builtin_isinf (ld) != 0)
46 link_error ();
48 if (__builtin_isfinite (f) != 1)
49 link_error ();
50 if (__builtin_isfinite (d) != 1)
51 link_error ();
52 if (__builtin_isfinite (ld) != 1)
53 link_error ();
55 if (f != f)
56 link_error ();
57 if (d != d)
58 link_error ();
59 if (ld != ld)
60 link_error ();
61 return 0;