aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/torture/inf-compare-8-float.c
blob: 5510c67401c8a2f902220d2349d872e8b4133c58 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
/* { dg-do run } */
/* { dg-add-options ieee } */
/* { dg-require-effective-target fenv_exceptions } */

#include <fenv.h>

extern void abort (void);
extern void exit (int);

volatile float x = __builtin_nan ("");
volatile int i;

int
main (void)
{
  i = x != -__builtin_inf ();
  if (i != 1 || fetestexcept (FE_INVALID))
    abort ();
}