Daily bump.
[official-gcc.git] / gcc / testsuite / gcc.c-torture / execute / ieee / fp-cmp-2.c
blobb1b5c7dc76597fc5370f4980cf211e53165fbe08
1 #ifndef SIGNAL_SUPPRESS
2 #include <signal.h>
3 #endif
5 void abort (void);
6 void exit (int);
8 float fnan = 1.0f/0.0f - 1.0f/0.0f;
9 float x = 1.0f;
11 void leave ()
13 exit (0);
16 int
17 main (void)
19 #if ! defined (__vax__) && ! defined (_CRAY)
20 /* Move this line earlier, for architectures (like alpha) that issue
21 SIGFPE on the first comparisons. */
22 #ifndef SIGNAL_SUPPRESS
23 /* Some machines catches a SIGFPE when a NaN is compared.
24 Let this test succeed o such machines. */
25 signal (SIGFPE, leave);
26 #endif
27 /* NaN is an IEEE unordered operand. All these test should be false. */
28 if (fnan == fnan)
29 abort ();
30 if (fnan != x)
31 x = 1.0;
32 else
33 abort ();
35 if (fnan < x)
36 abort ();
37 if (fnan > x)
38 abort ();
39 if (fnan <= x)
40 abort ();
41 if (fnan >= x)
42 abort ();
43 if (fnan == x)
44 abort ();
45 #endif
46 exit (0);