From 5d05d496b2b4a3d4674b2e5a46d3a355abf4055d Mon Sep 17 00:00:00 2001 From: Jakub Jelinek Date: Thu, 17 Apr 2025 12:14:15 +0200 Subject: [PATCH] libgomp: Don't test ompx::allocator::gnu_pinned_mem on non-linux targets. The libgomp.c/alloc-pinned*.c test have /* { dg-skip-if "Pinning not implemented on this host" { ! *-*-linux-gnu* } } */ so they are only run on Linux targets right now. Duplicating the tests or reworking them into headers looked like too much work for me right now this late in stage4, so I've just #ifdefed the uses at least for now. 2025-04-17 Jakub Jelinek PR libgomp/119849 * testsuite/libgomp.c++/allocator-1.C (test_inequality, main): Guard ompx::allocator::gnu_pinned_mem uses with #ifdef __gnu_linux__. * testsuite/libgomp.c++/allocator-2.C (main): Likewise. --- libgomp/testsuite/libgomp.c++/allocator-1.C | 13 +++++++++++++ libgomp/testsuite/libgomp.c++/allocator-2.C | 9 +++++++++ 2 files changed, 22 insertions(+) diff --git a/libgomp/testsuite/libgomp.c++/allocator-1.C b/libgomp/testsuite/libgomp.c++/allocator-1.C index f8207228488..49425386b33 100644 --- a/libgomp/testsuite/libgomp.c++/allocator-1.C +++ b/libgomp/testsuite/libgomp.c++/allocator-1.C @@ -78,7 +78,10 @@ void test_inequality () CHECK_INEQUALITY (omp::allocator::cgroup_mem, void); CHECK_INEQUALITY (omp::allocator::pteam_mem, void); CHECK_INEQUALITY (omp::allocator::thread_mem, void); +#ifdef __gnu_linux__ + /* Pinning not implemented on other targets. */ CHECK_INEQUALITY (ompx::allocator::gnu_pinned_mem, void); +#endif /* And again with the same type passed to the allocator. */ CHECK_INEQUALITY (omp::allocator::null_allocator, T); CHECK_INEQUALITY (omp::allocator::default_mem, T); @@ -89,7 +92,9 @@ void test_inequality () CHECK_INEQUALITY (omp::allocator::cgroup_mem, T); CHECK_INEQUALITY (omp::allocator::pteam_mem, T); CHECK_INEQUALITY (omp::allocator::thread_mem, T); +#ifdef __gnu_linux__ CHECK_INEQUALITY (ompx::allocator::gnu_pinned_mem, T); +#endif } #undef CHECK_INEQUALITY @@ -121,7 +126,9 @@ int main () test(42); test(42); test(42); +#ifdef __gnu_linux__ test(42); +#endif test(42); test(42); @@ -132,7 +139,9 @@ int main () test(42); test(42); test(42); +#ifdef __gnu_linux__ test(42); +#endif test( S{42, true, 128.f}); test( S{42, true, 128.f}); @@ -143,7 +152,9 @@ int main () test( S{42, true, 128.f}); test( S{42, true, 128.f}); test( S{42, true, 128.f}); +#ifdef __gnu_linux__ test(S{42, true, 128.f}); +#endif test_inequality(); test_inequality(); @@ -154,5 +165,7 @@ int main () test_inequality(); test_inequality(); test_inequality(); +#ifdef __gnu_linux__ test_inequality(); +#endif } diff --git a/libgomp/testsuite/libgomp.c++/allocator-2.C b/libgomp/testsuite/libgomp.c++/allocator-2.C index d25b75501a9..ca94fc7e376 100644 --- a/libgomp/testsuite/libgomp.c++/allocator-2.C +++ b/libgomp/testsuite/libgomp.c++/allocator-2.C @@ -86,7 +86,10 @@ int main () f(0, 1, 2, 3); f(0, 1, 2, 3); f(0, 1, 2, 3); +#ifdef __gnu_linux__ + /* Pinning not implemented on other targets. */ f(0, 1, 2, 3); +#endif f(0, 1, 2, 3); f(0, 1, 2, 3); @@ -97,7 +100,9 @@ int main () f(0, 1, 2, 3); f(0, 1, 2, 3); f(0, 1, 2, 3); +#ifdef __gnu_linux__ f(0, 1, 2, 3); +#endif S0 s0_0{ 42, true, 111128.f}; S0 s0_1{ 142, false, 11128.f}; @@ -112,7 +117,9 @@ int main () f(s0_0, s0_1, s0_2, s0_3); f(s0_0, s0_1, s0_2, s0_3); f(s0_0, s0_1, s0_2, s0_3); +#ifdef __gnu_linux__ f(s0_0, s0_1, s0_2, s0_3); +#endif S1 s1_0{ 42, true, 111128.f}; S1 s1_1{ 142, false, 11128.f}; @@ -128,5 +135,7 @@ int main () f(s1_0, s1_1, s1_2, s1_3); f(s1_0, s1_1, s1_2, s1_3); f(s1_0, s1_1, s1_2, s1_3); +#ifdef __gnu_linux__ f(s1_0, s1_1, s1_2, s1_3); +#endif } -- 2.47.2