public inbox for libstdc++-cvs@sourceware.org help / color / mirror / Atom feed
From: Jonathan Wakely <redi@gcc.gnu.org> To: gcc-cvs@gcc.gnu.org, libstdc++-cvs@gcc.gnu.org Subject: [gcc r10-10211] libstdc++: Fix some problems in PSTL tests Date: Wed, 13 Oct 2021 15:29:42 +0000 (GMT) [thread overview] Message-ID: <20211013152942.4F66E385843E@sourceware.org> (raw) https://gcc.gnu.org/g:fb8c9d6d72f709b002d1f14da9527ea6ca17cadc commit r10-10211-gfb8c9d6d72f709b002d1f14da9527ea6ca17cadc Author: Jonathan Wakely <jwakely@redhat.com> Date: Wed May 12 11:21:51 2021 +0100 libstdc++: Fix some problems in PSTL tests libstdc++-v3/ChangeLog: * testsuite/25_algorithms/pstl/alg_nonmodifying/find_end.cc: Increase dg-timeout-factor to 4. Fix -Wunused-parameter warnings. Replace bitwise AND with logical AND in loop condition. * testsuite/25_algorithms/pstl/alg_nonmodifying/search_n.cc: Replace bitwise AND with logical AND in loop condition. * testsuite/util/pstl/test_utils.h: Remove unused parameter names. (cherry picked from commit d1adbe5c1bd3f3ba098ff112eed9b61515e2dc20) Diff: --- .../testsuite/25_algorithms/pstl/alg_nonmodifying/find_end.cc | 8 ++++---- .../testsuite/25_algorithms/pstl/alg_nonmodifying/search_n.cc | 2 +- libstdc++-v3/testsuite/util/pstl/test_utils.h | 10 +++++----- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/libstdc++-v3/testsuite/25_algorithms/pstl/alg_nonmodifying/find_end.cc b/libstdc++-v3/testsuite/25_algorithms/pstl/alg_nonmodifying/find_end.cc index 08daa104173..30098d129fa 100644 --- a/libstdc++-v3/testsuite/25_algorithms/pstl/alg_nonmodifying/find_end.cc +++ b/libstdc++-v3/testsuite/25_algorithms/pstl/alg_nonmodifying/find_end.cc @@ -1,7 +1,7 @@ // -*- C++ -*- // { dg-options "-std=gnu++17 -ltbb" } // { dg-do run { target c++17 } } -// { dg-timeout-factor 3 } +// { dg-timeout-factor 4 } // { dg-require-effective-target tbb-backend } //===-- find_end.pass.cpp -------------------------------------------------===// @@ -78,8 +78,8 @@ test(const std::size_t bits) const std::size_t max_n1 = 1000; const std::size_t max_n2 = (max_n1 * 10) / 8; - Sequence<T> in(max_n1, [max_n1, bits](std::size_t k) { return T(2 * HashBits(max_n1, bits - 1) ^ 1); }); - Sequence<T> sub(max_n2, [max_n1, bits](std::size_t k) { return T(2 * HashBits(max_n1, bits - 1)); }); + Sequence<T> in(max_n1, [max_n1, bits](std::size_t) { return T(2 * HashBits(max_n1, bits - 1) ^ 1); }); + Sequence<T> sub(max_n2, [max_n1, bits](std::size_t) { return T(2 * HashBits(max_n1, bits - 1)); }); for (std::size_t n1 = 0; n1 <= max_n1; n1 = n1 <= 16 ? n1 + 1 : size_t(3.1415 * n1)) { std::size_t sub_n[] = {0, 1, 3, n1, (n1 * 10) / 8}; @@ -89,7 +89,7 @@ test(const std::size_t bits) for (auto r : res) { std::size_t i = r, isub = 0; - for (; i < n1 & isub < n2; ++i, ++isub) + for (; i < n1 && isub < n2; ++i, ++isub) in[i] = sub[isub]; invoke_on_all_policies(test_one_policy(), in.begin(), in.begin() + n1, sub.begin(), sub.begin() + n2, std::equal_to<T>()); diff --git a/libstdc++-v3/testsuite/25_algorithms/pstl/alg_nonmodifying/search_n.cc b/libstdc++-v3/testsuite/25_algorithms/pstl/alg_nonmodifying/search_n.cc index 0720c377011..5ecf2ce3616 100644 --- a/libstdc++-v3/testsuite/25_algorithms/pstl/alg_nonmodifying/search_n.cc +++ b/libstdc++-v3/testsuite/25_algorithms/pstl/alg_nonmodifying/search_n.cc @@ -79,7 +79,7 @@ test() { Sequence<T> in(n1, [n1](std::size_t k) { return T(0); }); std::size_t i = r, isub = 0; - for (; i < n1 & isub < n2; ++i, ++isub) + for (; i < n1 && isub < n2; ++i, ++isub) in[i] = value; invoke_on_all_policies(test_one_policy(), in.begin(), in.begin() + n1, n2, value, std::equal_to<T>()); diff --git a/libstdc++-v3/testsuite/util/pstl/test_utils.h b/libstdc++-v3/testsuite/util/pstl/test_utils.h index 6547d931c29..80a8f9c7b87 100644 --- a/libstdc++-v3/testsuite/util/pstl/test_utils.h +++ b/libstdc++-v3/testsuite/util/pstl/test_utils.h @@ -752,7 +752,7 @@ struct invoke_if_<std::false_type, std::false_type> { template <typename Op, typename... Rest> void - operator()(bool is_allow, Op op, Rest&&... rest) + operator()(bool, Op op, Rest&&... rest) { op(std::forward<Rest>(rest)...); } @@ -787,14 +787,14 @@ struct non_const_wrapper_tagged : non_const_wrapper template <typename Policy, typename Iterator> typename std::enable_if<IsPositiveCondition != is_same_iterator_category<Iterator, IteratorTag>::value, void>::type - operator()(Policy&& exec, Iterator iter) + operator()(Policy&&, Iterator) { } template <typename Policy, typename InputIterator, typename OutputIterator> typename std::enable_if<IsPositiveCondition != is_same_iterator_category<OutputIterator, IteratorTag>::value, void>::type - operator()(Policy&& exec, InputIterator input_iter, OutputIterator out_iter) + operator()(Policy&&, InputIterator, OutputIterator) { } }; @@ -999,7 +999,7 @@ struct iterator_invoker<std::forward_iterator_tag, /*isReverse=*/std::true_type> { template <typename... Rest> void - operator()(Rest&&... rest) + operator()(Rest&&...) { } }; @@ -1226,7 +1226,7 @@ test_algo_basic_double(F&& f) template <typename Policy, typename F> static void -invoke_if(Policy&& p, F f) +invoke_if(Policy&&, F f) { #if _PSTL_ICC_16_VC14_TEST_SIMD_LAMBDA_DEBUG_32_BROKEN || _PSTL_ICC_17_VC141_TEST_SIMD_LAMBDA_DEBUG_32_BROKEN __pstl::__internal::invoke_if_not(__pstl::__internal::allow_unsequenced<Policy>(), f);
reply other threads:[~2021-10-13 15:29 UTC|newest] Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=20211013152942.4F66E385843E@sourceware.org \ --to=redi@gcc.gnu.org \ --cc=gcc-cvs@gcc.gnu.org \ --cc=libstdc++-cvs@gcc.gnu.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
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).