bug-gnulib@gnu.org mirror (unofficial)
 help / color / mirror / Atom feed
* fenv-rounding: Avoid a test failure on OpenBSD/arm64
@ 2024-01-18 23:58 Bruno Haible
  0 siblings, 0 replies; only message in thread
From: Bruno Haible @ 2024-01-18 23:58 UTC (permalink / raw)
  To: bug-gnulib

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  <bruno@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;
 





^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2024-01-18 23:58 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-01-18 23:58 fenv-rounding: Avoid a test failure on OpenBSD/arm64 Bruno Haible

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).