public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH 1/2] libstdc++: Work around some PSTL test failures for debug mode [PR90276]
@ 2024-06-20 15:35 Jonathan Wakely
  2024-06-20 15:35 ` [PATCH 2/2] libstdc++: Increase timeouts for PSTL tests in " Jonathan Wakely
  2024-06-26 20:13 ` [PATCH 1/2] libstdc++: Work around some PSTL test failures for " Jonathan Wakely
  0 siblings, 2 replies; 4+ messages in thread
From: Jonathan Wakely @ 2024-06-20 15:35 UTC (permalink / raw)
  To: libstdc++, gcc-patches

Tested x86_64-linux.

-- >8 --

This addresses one known failure due to a bug in the upstream tests, and
a number of timeouts due to the algorithms running much more slowly with
debug mode checks enabled.

libstdc++-v3/ChangeLog:

	PR libstdc++/90276
	* testsuite/25_algorithms/pstl/alg_sorting/partial_sort.cc
	[_GLIBCXX_DEBUG]: Add xfail-run-if for debug mode.
	* testsuite/25_algorithms/pstl/alg_nonmodifying/nth_element.cc
	[_GLIBCXX_DEBUG]: Reduce size of test data.
	* testsuite/25_algorithms/pstl/alg_sorting/includes.cc:
	Likewise.
	* testsuite/25_algorithms/pstl/alg_sorting/set_util.h:
	Likewise.
---
 .../25_algorithms/pstl/alg_nonmodifying/nth_element.cc        | 4 ++++
 .../testsuite/25_algorithms/pstl/alg_sorting/includes.cc      | 4 ++++
 .../testsuite/25_algorithms/pstl/alg_sorting/partial_sort.cc  | 1 +
 .../testsuite/25_algorithms/pstl/alg_sorting/set_util.h       | 4 ++++
 4 files changed, 13 insertions(+)

diff --git a/libstdc++-v3/testsuite/25_algorithms/pstl/alg_nonmodifying/nth_element.cc b/libstdc++-v3/testsuite/25_algorithms/pstl/alg_nonmodifying/nth_element.cc
index 61bbca758b4..63e6abe2ea4 100644
--- a/libstdc++-v3/testsuite/25_algorithms/pstl/alg_nonmodifying/nth_element.cc
+++ b/libstdc++-v3/testsuite/25_algorithms/pstl/alg_nonmodifying/nth_element.cc
@@ -133,7 +133,11 @@ void
 test_by_type(Generator1 generator1, Generator2 generator2, Compare comp)
 {
     using namespace std;
+#ifdef _GLIBCXX_DEBUG
+    size_t max_size = 1000;
+#else
     size_t max_size = 10000;
+#endif
     Sequence<T> in1(max_size, [](size_t v) { return T(v); });
     Sequence<T> exp(max_size, [](size_t v) { return T(v); });
     size_t m;
diff --git a/libstdc++-v3/testsuite/25_algorithms/pstl/alg_sorting/includes.cc b/libstdc++-v3/testsuite/25_algorithms/pstl/alg_sorting/includes.cc
index ed07810618d..1567c369c4c 100644
--- a/libstdc++-v3/testsuite/25_algorithms/pstl/alg_sorting/includes.cc
+++ b/libstdc++-v3/testsuite/25_algorithms/pstl/alg_sorting/includes.cc
@@ -77,7 +77,11 @@ void
 test_includes(Compare compare)
 {
 
+#ifdef _GLIBCXX_DEBUG
+    const std::size_t n_max = 10000;
+#else
     const std::size_t n_max = 1000000;
+#endif
 
     // The rand()%(2*n+1) encourages generation of some duplicates.
     std::srand(42);
diff --git a/libstdc++-v3/testsuite/25_algorithms/pstl/alg_sorting/partial_sort.cc b/libstdc++-v3/testsuite/25_algorithms/pstl/alg_sorting/partial_sort.cc
index 6d441cc3ae9..797d0ee9340 100644
--- a/libstdc++-v3/testsuite/25_algorithms/pstl/alg_sorting/partial_sort.cc
+++ b/libstdc++-v3/testsuite/25_algorithms/pstl/alg_sorting/partial_sort.cc
@@ -3,6 +3,7 @@
 // { dg-do run { target c++17 } }
 // { dg-timeout-factor 3 }
 // { dg-require-effective-target tbb_backend }
+// { dg-xfail-run-if "see PR 90276" { debug_mode } }
 
 //===-- partial_sort.pass.cpp ---------------------------------------------===//
 //
diff --git a/libstdc++-v3/testsuite/25_algorithms/pstl/alg_sorting/set_util.h b/libstdc++-v3/testsuite/25_algorithms/pstl/alg_sorting/set_util.h
index ecf5cd1c89d..214e3452aa7 100644
--- a/libstdc++-v3/testsuite/25_algorithms/pstl/alg_sorting/set_util.h
+++ b/libstdc++-v3/testsuite/25_algorithms/pstl/alg_sorting/set_util.h
@@ -51,7 +51,11 @@ namespace TestUtils
     void
     test_set_op(Compare compare)
     {
+#ifdef _GLIBCXX_DEBUG
+        const std::size_t n_max = 1000;
+#else
         const std::size_t n_max = 100000;
+#endif
 
         // The rand()%(2*n+1) encourages generation of some duplicates.
         std::srand(4200);
-- 
2.45.2


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

end of thread, other threads:[~2024-06-26 20:13 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-06-20 15:35 [PATCH 1/2] libstdc++: Work around some PSTL test failures for debug mode [PR90276] Jonathan Wakely
2024-06-20 15:35 ` [PATCH 2/2] libstdc++: Increase timeouts for PSTL tests in " Jonathan Wakely
2024-06-26 20:13   ` Jonathan Wakely
2024-06-26 20:13 ` [PATCH 1/2] libstdc++: Work around some PSTL test failures for " Jonathan Wakely

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