aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/torture/inf-compare-2.c
blob: f6a1c00b6239164bb2ad23858ae2c5a81fe1784c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
/* { dg-do run { xfail { powerpc*-*-* } } } */
/* remove the xfail for powerpc when pr58684 is fixed */
/* { dg-add-options ieee } */
/* { dg-require-effective-target fenv_exceptions_double } */
/* { dg-skip-if "fenv" { powerpc-ibm-aix* } } */
/* { dg-additional-options "-fno-tree-dominator-opts -fno-tree-vrp" } */

#include <fenv.h>

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

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

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