On Solaris 11 OpenIndiana, with CC="gcc -m32", I see a test failure:

FAIL: test-fenv-except-tracking-3.sh
====================================

../../gltests/test-fenv-except-tracking-3.sh: line 8: 92593: Floating 
exception(coredump)
../../gltests/test-fenv-except-tracking-3.sh: line 8: 92594: Floating 
exception(coredump)
Failed: ./test-fenv-except-tracking-3 FE_OVERFLOW
FAIL test-fenv-except-tracking-3.sh (exit status: 1)

Testing it manually, indeed

  ./test-fenv-except-tracking-3 FE_UNDERFLOW

does not crash by SIGFPE. To make it crash, one needs some more
floating-point operations (like in other unit tests).


2026-08-31  Bruno Haible  <[email protected]>

        fenv-exceptions-tracking-c99 tests: Fix test on Solaris 11 OpenIndiana.
        * tests/test-fenv-except-tracking-3.c (a, b, al, bl): New variables.
        (main): Do a harmless floating-point operation after feraiseexcept.

diff --git a/tests/test-fenv-except-tracking-3.c 
b/tests/test-fenv-except-tracking-3.c
index a2178442b6..b53ad68b2b 100644
--- a/tests/test-fenv-except-tracking-3.c
+++ b/tests/test-fenv-except-tracking-3.c
@@ -34,6 +34,9 @@
 
 /* Check that feraiseexcept() can trigger a trap.  */
 
+static volatile double a, b;
+static volatile long double al, bl;
+
 int
 main (int argc, char *argv[])
 {
@@ -63,6 +66,12 @@ main (int argc, char *argv[])
         }
 
       feraiseexcept (exception);
+
+      /* Do a harmless floating-point operation (since on some CPUs,
+         floating-point exceptions trigger a trap only at the next
+         floating-point operation).  */
+      a = 1.0; b = a + a;
+      al = 1.0L; bl = al + al;
     }
 
   return test_exit_status;




Reply via email to