aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexandre Oliva <oliva@adacore.com>2024-06-13 20:10:55 -0300
committerAlexandre Oliva <oliva@gnu.org>2024-06-13 20:10:55 -0300
commit9b8c3e622c7cd4ea393f59b873c3107767e1ba88 (patch)
tree0cb87f29c6e76598e9905bc04f0d0a78f342d721
parent3bb21028698be33ae90115fce507f151182a4450 (diff)
downloadgcc-9b8c3e622c7cd4ea393f59b873c3107767e1ba88.zip
gcc-9b8c3e622c7cd4ea393f59b873c3107767e1ba88.tar.gz
gcc-9b8c3e622c7cd4ea393f59b873c3107767e1ba88.tar.bz2
[libstdc++] [testsuite] require cmath for [PR114359]
When !_GLIBCXX_USE_C99_MATH_TR1, binomial_distribution doesn't use the optimized algorithm that was fixed in response to PR114359. Without that optimized algorithm, operator() ends up looping very very long for the test, to the point that it would time out by several orders of magnitude, without even exercising the optimized algorithm that we're testing for regressions. Arrange for the test to be skipped if that bit won't be exercised. for libstdc++-v3/ChangeLog PR libstdc++/114359 * testsuite/26_numerics/random/binomial_distribution/114359.cc: Require cmath.
-rw-r--r--libstdc++-v3/testsuite/26_numerics/random/binomial_distribution/114359.cc13
1 files changed, 13 insertions, 0 deletions
diff --git a/libstdc++-v3/testsuite/26_numerics/random/binomial_distribution/114359.cc b/libstdc++-v3/testsuite/26_numerics/random/binomial_distribution/114359.cc
index c1e4c38..12d967d 100644
--- a/libstdc++-v3/testsuite/26_numerics/random/binomial_distribution/114359.cc
+++ b/libstdc++-v3/testsuite/26_numerics/random/binomial_distribution/114359.cc
@@ -2,6 +2,19 @@
// Bug 114359 - std::binomial_distribution hangs in infinite loop
+// { dg-require-cmath "" }
+
+// The requirement above is not strictly true. The test should work
+// without cmath, and it probably does, but without cmath,
+// binomial_distribution::operator() skips the optimized algorithm and
+// calls _M_waiting to loop a gazillion times. On aarch64-rtems6
+// qemu, that loop takes over 5 minutes to go through a small fraction
+// of the iteration space (__x at 22k, limited at 1G; __sum at 2e-5,
+// limited at 0.69). The bug we're regression-testing here was in the
+// cmath-requiring bit, so even if this could conceivably not time out
+// on a really fast machine, there's hardly any reason to exercise
+// this extreme case.
+
#include <random>
int main()