]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
libstdc++: Work around some PSTL test failures for debug mode [PR90276]
authorJonathan Wakely <jwakely@redhat.com>
Thu, 6 Jun 2024 10:50:06 +0000 (11:50 +0100)
committerJonathan Wakely <redi@gcc.gnu.org>
Wed, 26 Jun 2024 20:14:14 +0000 (21:14 +0100)
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.

libstdc++-v3/testsuite/25_algorithms/pstl/alg_nonmodifying/nth_element.cc
libstdc++-v3/testsuite/25_algorithms/pstl/alg_sorting/includes.cc
libstdc++-v3/testsuite/25_algorithms/pstl/alg_sorting/partial_sort.cc
libstdc++-v3/testsuite/25_algorithms/pstl/alg_sorting/set_util.h

index 61bbca758b4ffb6608195a82ee0aaf593c80d6f1..63e6abe2ea468137632da75b5a29dbac7ff3c6c0 100644 (file)
@@ -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;
index ed07810618d6c352480c006257f6ede74cfce916..1567c369c4cdb636a0cd73c79a4ee7f103607f35 100644 (file)
@@ -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);
index 6d441cc3ae9df946020721a99d5343bbc284d18b..797d0ee9340cf507d6670edd6443b319e94c7e9c 100644 (file)
@@ -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 ---------------------------------------------===//
 //
index ecf5cd1c89db65ce7cf8a33b2e05a20f031ec30d..214e3452aa754c27620bbbec65e4662f44d3942e 100644 (file)
@@ -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);