summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/torture/float128-mul-underflow.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/gcc.dg/torture/float128-mul-underflow.c')
-rw-r--r--gcc/testsuite/gcc.dg/torture/float128-mul-underflow.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/torture/float128-mul-underflow.c b/gcc/testsuite/gcc.dg/torture/float128-mul-underflow.c
new file mode 100644
index 00000000000..e3ebfffc98f
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/torture/float128-mul-underflow.c
@@ -0,0 +1,21 @@
+/* Test __float128 multiplication uses after-rounding tininess
+ detection. */
+
+/* { dg-do run { target i?86-*-* x86_64-*-* ia64-*-* } } */
+/* { dg-options "" } */
+/* { dg-require-effective-target fenv_exceptions } */
+
+#include <fenv.h>
+#include <stdlib.h>
+
+int
+main (void)
+{
+ volatile __float128 a = 0x1.fffffffffffffffp-16382q, b = 0x1.0000000000000008p-1q, c;
+ c = a * b;
+ if (fetestexcept (FE_UNDERFLOW))
+ abort ();
+ if (c != 0x1p-16382q)
+ abort ();
+ exit (0);
+}