]> Savannah Git Hosting - gnulib.git/commitdiff
fenv-exceptions-trapping: Avoid test failure on older systems.
authorBruno Haible <bruno@clisp.org>
Sun, 5 Nov 2023 11:49:43 +0000 (12:49 +0100)
committerBruno Haible <bruno@clisp.org>
Sun, 5 Nov 2023 11:49:43 +0000 (12:49 +0100)
* tests/test-fenv-except-trapping-2.c (main): Skip the test also on x86
systems with gcc < 8.

ChangeLog
tests/test-fenv-except-trapping-2.c

index 55a85289f50055821380bdeee9322c5ec3f44521..766cbfb5f9734d20e7a5efe8b0c31f17db4261b6 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2023-11-05  Bruno Haible  <bruno@clisp.org>
+
+       fenv-exceptions-trapping: Avoid test failure on older systems.
+       * tests/test-fenv-except-trapping-2.c (main): Skip the test also on x86
+       systems with gcc < 8.
+
 2023-11-04  Bruno Haible  <bruno@clisp.org>
 
        fenv-exceptions-trapping: Fix for powerpc* platforms.
index 99a67d09694ec6c992cf8c8aada35e6ff86d6a3f..e11a31da84ecce1700ea914685251a4e82a72533 100644 (file)
@@ -425,14 +425,35 @@ main (int argc, char *argv[])
 
       /* Avoid known test failures.  */
       int known_failure = 0;
-      /* The '4' tests do not work on Linux/powerpc* and Linux/s390*, as well as
-         on GNU/kFreeBSD/i386, GNU/kFreeBSD/x86_64, musl libc/i386,
-         musl libc/powerpc64le, macOS/i386, macOS/x86_64, macOS/arm64,
-         FreeBSD/i386, FreeBSD/x86_64, NetBSD/i386, NetBSD/x86_64, OpenBSD/i386,
-         OpenBSD/x86_64, AIX/powerpc, Solaris/i386, Solaris/x86_64,
-         Cygwin/x86_64, native Windows/i386,
-         native Windows/x86_64.  */
-      #if (__GLIBC__ >= 2 && (defined __powerpc__ || (defined __s390__ || defined __s390x__))) \
+      /* The '4' tests do not work
+         - on glibc/{i386,x86_64}, with gcc < 8 (except when option -mno-ieee-fp
+           is used) or with clang,
+         - on glibc/powerpc* and glibc/s390*,
+         - as well as on
+           GNU/kFreeBSD/i386, GNU/kFreeBSD/x86_64,
+           musl libc/i386, musl libc/powerpc64le,
+           macOS/i386, macOS/x86_64, macOS/arm64,
+           FreeBSD/i386, FreeBSD/x86_64,
+           NetBSD/i386, NetBSD/x86_64,
+           OpenBSD/i386, OpenBSD/x86_64,
+           AIX/powerpc,
+           Solaris/i386, Solaris/x86_64,
+           Cygwin/x86_64,
+           native Windows/i386, native Windows/x86_64.
+         Explanation of some of the {i386,x86_64} cases:
+         - Quoting the Intel 64 and IA-32 Architectures Software Developer's
+           Manual:
+           "The UCOMISD instruction differs from the COMISD instruction in that
+            it signals a SIMD floating-point invalid operation exception (#I)
+            only when a source operand is an SNaN. The COMISD instruction
+            signals an invalid numeric exception only if a source operand is
+            either an SNaN or a QNaN."
+         - gcc < 8 (except when option -mno-ieee-fp is used) generates 'ucom*'
+           or 'fucom*' instructions and thus fails the test.
+         - gcc >= 8 generates 'com*' or 'fcom*' instructions and thus passes
+           the test.  */
+      #if (__GLIBC__ >= 2 && ((defined __x86_64__ || defined _M_X64) || (defined __i386 || defined _M_IX86)) && __GNUC__ < 8) \
+          || (__GLIBC__ >= 2 && (defined __powerpc__ || (defined __s390__ || defined __s390x__))) \
           || (__GLIBC__ >= 2 && __FreeBSD_kernel__ && ((defined __x86_64__ || defined _M_X64) || (defined __i386 || defined _M_IX86))) \
           || (defined MUSL_LIBC && ((defined __i386 || defined _M_IX86) || defined __powerpc__)) \
           || ((defined __APPLE__ && defined __MACH__) && ((defined __x86_64__ || defined _M_X64) || (defined __i386 || defined _M_IX86) || defined __aarch64__)) \