Debian Codegraph @

gcc/testsuite/gcc.c-torture/execute/ieee/fp-cmp-6.c

raw
1
2 const double dnan = 1.0/0.0 - 1.0/0.0;
3 double x = 1.0;
4
5 extern void link_error (void);
6 extern void abort (void);
7 extern void exit (int);
8
9 int
10 main (void)
11 {
12 #if ! defined (__vax__) && ! defined (_CRAY)
13 /* NaN is an IEEE unordered operand. All these test should be false. */
14 if (dnan == dnan)
15 link_error ();
16 if (dnan != x)
17 x = 1.0;
18 else
19 link_error ();
20
21 if (dnan < x)
22 link_error ();
23 if (dnan > x)
24 link_error ();
25 if (dnan <= x)
26 link_error ();
27 if (dnan >= x)
28 link_error ();
29 if (dnan == x)
30 link_error ();
31 #endif
32 exit (0);
33 }
34
35 #ifndef __OPTIMIZE__
36 void link_error (void)
37 {
38 abort ();
39 }
40 #endif
41