public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] libgomp, testsuite: Do not call nonstandard functions on darwin
@ 2023-08-20 19:37 FX Coudert
  2023-08-21 19:12 ` Tobias Burnus
  0 siblings, 1 reply; 11+ messages in thread
From: FX Coudert @ 2023-08-20 19:37 UTC (permalink / raw)
  To: GCC Patches; +Cc: Jakub Jelinek, tobias

[-- Attachment #1: Type: text/plain, Size: 342 bytes --]

Hi,

testsuite/libgomp.c/simd-math-1.c calls nonstandard functions that are not available on darwin (and possibly other systems?). Because I did not want to disable their testing completely, I suggest we simply use preprocessor macros to avoid them on darwin.

This fixes the test failure on aarch64-apple-darwin.
OK to commit?

FX


[-- Attachment #2: 0001-libgomp-testsuite-Do-not-call-nonstandard-functions-.patch --]
[-- Type: application/octet-stream, Size: 2740 bytes --]

From bc7f4862b9301c9490c7e80a58aa21c7a9727bcd Mon Sep 17 00:00:00 2001
From: Francois-Xavier Coudert <fxcoudert@gmail.com>
Date: Sun, 20 Aug 2023 21:32:18 +0200
Subject: [PATCH] libgomp, testsuite: Do not call nonstandard functions on
 darwin

The following functions are not standard, and not always available on
darwin. They should not be called there: gamma, gammaf, scalb, scalbf,
significand, and significandf.

libgomp/ChangeLog:

	* testsuite/libgomp.c/simd-math-1.c: Avoid calling nonstandard
	functions on darwin.
---
 libgomp/testsuite/libgomp.c/simd-math-1.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/libgomp/testsuite/libgomp.c/simd-math-1.c b/libgomp/testsuite/libgomp.c/simd-math-1.c
index dd2077cc597..b6127c118d1 100644
--- a/libgomp/testsuite/libgomp.c/simd-math-1.c
+++ b/libgomp/testsuite/libgomp.c/simd-math-1.c
@@ -160,7 +160,9 @@ int main (void)
   TEST_FUN (float, -10.0, 10.0, expf);
   TEST_FUN (float, -10.0, 10.0, exp2f);
   TEST_FUN2 (float, -10.0, 10.0, 100.0, -25.0, fmodf);
+#if !defined(__APPLE__)
   TEST_FUN (float, -10.0, 10.0, gammaf);
+#endif
   TEST_FUN2 (float, -10.0, 10.0, 15.0, -5.0,hypotf);
   TEST_FUN (float, -10.0, 10.0, lgammaf);
   TEST_FUN (float, -1.0, 50.0, logf);
@@ -169,8 +171,10 @@ int main (void)
   TEST_FUN2 (float, -100.0, 100.0, 100.0, -100.0, powf);
   TEST_FUN2 (float, -50.0, 100.0, -2.0, 40.0, remainderf);
   TEST_FUN (float, -50.0, 50.0, rintf);
+#if !defined(__APPLE__)
   TEST_FUN2 (float, -50.0, 50.0, -10.0, 32.0, __builtin_scalbf);
   TEST_FUN (float, -10.0, 10.0, __builtin_significandf);
+#endif
   TEST_FUN (float, -3.14159265359, 3.14159265359, sinf);
   TEST_FUN (float, -3.14159265359, 3.14159265359, sinhf);
   TEST_FUN (float, -0.1, 10000.0, sqrtf);
@@ -193,7 +197,9 @@ int main (void)
   TEST_FUN (double, -10.0, 10.0, exp);
   TEST_FUN (double, -10.0, 10.0, exp2);
   TEST_FUN2 (double, -10.0, 10.0, 100.0, -25.0, fmod);
+#if !defined(__APPLE__)
   TEST_FUN (double, -10.0, 10.0, gamma);
+#endif
   TEST_FUN2 (double, -10.0, 10.0, 15.0, -5.0, hypot);
   TEST_FUN (double, -10.0, 10.0, lgamma);
   TEST_FUN (double, -1.0, 50.0, log);
@@ -202,8 +208,10 @@ int main (void)
   TEST_FUN2 (double, -100.0, 100.0, 100.0, -100.0, pow);
   TEST_FUN2 (double, -50.0, 100.0, -2.0, 40.0, remainder);
   TEST_FUN (double, -50.0, 50.0, rint);
+#if !defined(__APPLE__)
   TEST_FUN2 (double, -50.0, 50.0, -10.0, 32.0, __builtin_scalb);
   TEST_FUN (double, -10.0, 10.0, __builtin_significand);
+#endif
   TEST_FUN (double, -3.14159265359, 3.14159265359, sin);
   TEST_FUN (double, -3.14159265359, 3.14159265359, sinh);
   TEST_FUN (double, -0.1, 10000.0, sqrt);
-- 
2.39.2 (Apple Git-143)


^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2023-08-22 17:10 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-08-20 19:37 [PATCH] libgomp, testsuite: Do not call nonstandard functions on darwin FX Coudert
2023-08-21 19:12 ` Tobias Burnus
2023-08-21 19:41   ` Jakub Jelinek
2023-08-21 19:50     ` FX Coudert
2023-08-21 19:55       ` Jakub Jelinek
2023-08-21 20:00         ` FX Coudert
2023-08-21 20:11           ` Jakub Jelinek
2023-08-22  8:16             ` FX Coudert
2023-08-22  8:23               ` Jakub Jelinek
2023-08-22  8:25               ` FX Coudert
2023-08-22 17:10                 ` Jakub Jelinek

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).