On OpenBSD 7.4/arm64, I'm seeing this test failure:

$ ./test-fenv-round                                             
../../gltests/test-fenv-round.c:53: assertion 'p < a' failed
Abort trap (core dumped) 

As usual, the problem is that the soft-float functions
(__divtf3, __eqtf2, __multf3) ignore the current rounding mode.

This patch avoids the test failure:


2024-01-18  Bruno Haible  <br...@clisp.org>

        fenv-rounding: Avoid a test failure on OpenBSD/arm64.
        * tests/test-fenv-round.c (test_towardzero, test_upward, test_downward):
        Skip the 'long double' tests on OpenBSD/arm64.
        * doc/posix-functions/fesetround.texi: Update platforms list.

diff --git a/doc/posix-functions/fesetround.texi 
b/doc/posix-functions/fesetround.texi
index bb06c4192a..56c8876291 100644
--- a/doc/posix-functions/fesetround.texi
+++ b/doc/posix-functions/fesetround.texi
@@ -20,5 +20,5 @@
 @itemize
 @item
 The rounding mode has no effect on @code{long double} operations on some 
platforms:
-FreeBSD/arm64, NetBSD/sparc64, OpenBSD/mips64.
+FreeBSD/arm64, NetBSD/sparc64, OpenBSD/arm64, OpenBSD/mips64.
 @end itemize
diff --git a/tests/test-fenv-round.c b/tests/test-fenv-round.c
index db2cd01c71..ce56048e51 100644
--- a/tests/test-fenv-round.c
+++ b/tests/test-fenv-round.c
@@ -45,7 +45,7 @@ test_towardzero ()
     a = -1; b = 3; q = a / b; p = b * q;
     ASSERT (p > a);
   }
-#if !((defined __FreeBSD__ && defined __aarch64__) || (defined __NetBSD__ && 
defined __sparcv9 /* sparc64 */) || (defined __OpenBSD__ && defined __mips64))
+#if !(((defined __FreeBSD__ || defined __OpenBSD__) && defined __aarch64__) || 
(defined __NetBSD__ && defined __sparcv9 /* sparc64 */) || (defined __OpenBSD__ 
&& defined __mips64))
   {
     long double volatile a, b, q, p;
 
@@ -80,7 +80,7 @@ test_upward ()
     a = -1; b = 3; q = a / b; p = b * q;
     ASSERT (p > a);
   }
-#if !((defined __FreeBSD__ && defined __aarch64__) || (defined __NetBSD__ && 
defined __sparcv9 /* sparc64 */) || (defined __OpenBSD__ && defined __mips64))
+#if !(((defined __FreeBSD__ || defined __OpenBSD__) && defined __aarch64__) || 
(defined __NetBSD__ && defined __sparcv9 /* sparc64 */) || (defined __OpenBSD__ 
&& defined __mips64))
   {
     long double volatile a, b, q, p;
 
@@ -115,7 +115,7 @@ test_downward ()
     a = -1; b = 3; q = a / b; p = b * q;
     ASSERT (p < a);
   }
-#if !((defined __FreeBSD__ && defined __aarch64__) || (defined __NetBSD__ && 
defined __sparcv9 /* sparc64 */) || (defined __OpenBSD__ && defined __mips64))
+#if !(((defined __FreeBSD__ || defined __OpenBSD__) && defined __aarch64__) || 
(defined __NetBSD__ && defined __sparcv9 /* sparc64 */) || (defined __OpenBSD__ 
&& defined __mips64))
   {
     long double volatile a, b, q, p;
 




Reply via email to