summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.c-torture/execute/ieee/hugeval.c
blob: 15f7088e19d673162a64e9c21b10483000cb6e32 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#include <math.h>

static const double zero =  0.0;
static const double pone =  1.0;
static const double none = -1.0;
static const double pinf =  1.0 / 0.0;
static const double ninf = -1.0 / 0.0;

int
main ()
{
  if (pinf != pone/zero)
    abort ();

  if (ninf != none/zero)
    abort ();

#ifdef HUGE_VAL
  if (HUGE_VAL != pinf)
    abort ();

  if (-HUGE_VAL != ninf)
    abort ();
#endif

  exit (0);
}