Debian Codegraph @

gcc/testsuite/gcc.c-torture/execute/ieee/hugeval.c

raw
1 #include <math.h>
2
3 void abort (void);
4 void exit (int);
5
6 static const double zero = 0.0;
7 static const double pone = 1.0;
8 static const double none = -1.0;
9 static const double pinf = 1.0 / 0.0;
10 static const double ninf = -1.0 / 0.0;
11
12 int
13 main ()
14 {
15 if (pinf != pone/zero)
16 abort ();
17
18 if (ninf != none/zero)
19 abort ();
20
21 #ifdef HUGE_VAL
22 if (HUGE_VAL != pinf)
23 abort ();
24
25 if (-HUGE_VAL != ninf)
26 abort ();
27 #endif
28
29 exit (0);
30 }