Debian Codegraph @

gcc/testsuite/gcc.dg/torture/float128-cmp-invalid.c

raw
1 /* Test for "invalid" exceptions from __float128 comparisons. */
2 /* { dg-do run } */
3 /* { dg-xfail-run-if "xfail for ppc float128_hw" { ppc_float128_hw || { ppc_cpu_supports_hw && p9vector_hw } } } */
4 /* { dg-options "" } */
5 /* { dg-require-effective-target __float128 } */
6 /* { dg-require-effective-target base_quadfloat_support } */
7 /* { dg-require-effective-target fenv_exceptions } */
8 /* { dg-add-options __float128 } */
9
10 #include <fenv.h>
11 #include <stdlib.h>
12
13 int
14 main (void)
15 {
16 volatile __float128 a = __builtin_nanq (""), b = 0.0q;
17 volatile int r = a < b;
18 if (!fetestexcept (FE_INVALID))
19 abort ();
20 if (r)
21 abort ();
22 exit (0);
23 }