Debian Codegraph @

gcc/testsuite/gcc.dg/torture/float128-div-underflow.c

raw
1 /* Test for spurious underflow from __float128 division. */
2 /* { dg-do run } */
3 /* { dg-options "" } */
4 /* { dg-require-effective-target __float128 } */
5 /* { dg-require-effective-target base_quadfloat_support } */
6 /* { dg-require-effective-target fenv_exceptions } */
7 /* { dg-add-options __float128 } */
8
9 #include <fenv.h>
10 #include <stdlib.h>
11
12 int
13 main (void)
14 {
15 volatile __float128 a = 0x0.fffp-16382q, b = 0x0.fffp0q, c;
16 c = a / b;
17 if (fetestexcept (FE_UNDERFLOW | FE_INEXACT))
18 abort ();
19 if (c != 0x1p-16382q)
20 abort ();
21 exit (0);
22 }