aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/torture/float128-cmp-invalid.c
blob: a86592b332829777c840257953e4f8054dbadf5a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
/* Test for "invalid" exceptions from __float128 comparisons.  */
/* { dg-do run } */
/* { dg-xfail-run-if "xfail for ppc float128_hw" { ppc_float128_hw || { ppc_cpu_supports_hw && p9vector_hw } } } */
/* { dg-options "" } */
/* { dg-require-effective-target __float128 } */
/* { dg-require-effective-target base_quadfloat_support } */
/* { dg-require-effective-target fenv_exceptions } */
/* { dg-add-options __float128 } */

#include <fenv.h>
#include <stdlib.h>

int
main (void)
{
  volatile __float128 a = __builtin_nanq (""), b = 0.0q;
  volatile int r = a < b;
  if (!fetestexcept (FE_INVALID))
    abort ();
  if (r)
    abort ();
  exit (0);
}