From patchwork Wed May 12 13:51:58 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Wakely X-Patchwork-Id: 1477607 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=8.43.85.97; helo=sourceware.org; envelope-from=gcc-patches-bounces@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.a=rsa-sha256 header.s=default header.b=fW+HklR3; dkim-atps=neutral Received: from sourceware.org (ip-8-43-85-97.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4FgGSC0GcTz9s1l for ; Wed, 12 May 2021 23:52:09 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 73099393BC05; Wed, 12 May 2021 13:52:06 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 73099393BC05 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1620827526; bh=KqmA2TOyijsaGzZn/U05g6jd2X3LwFUbD/Epyuu4aCI=; h=Date:To:Subject:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=fW+HklR3iAhocLMdS+STWqjllvtFplYY6sBRn1cJ0uyv0bSm8xmmKif663gi2cH9j Y+b0Br5GvHqFGXDtqBOrixTHfmQOqb4d/evVeO4tGUA92n31c8v1VIe3QC3vx6veKy RY3FOd7aTVVSEyy4i+CLUYXorB0V6hXU1VKQyagM= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by sourceware.org (Postfix) with ESMTP id 75BC73835805 for ; Wed, 12 May 2021 13:52:03 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 75BC73835805 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-520-sOrr88mSOUG0dDwSCGKRXw-1; Wed, 12 May 2021 09:52:00 -0400 X-MC-Unique: sOrr88mSOUG0dDwSCGKRXw-1 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id DA10E1018F7F; Wed, 12 May 2021 13:51:59 +0000 (UTC) Received: from localhost (unknown [10.33.36.164]) by smtp.corp.redhat.com (Postfix) with ESMTP id 872F65D6AC; Wed, 12 May 2021 13:51:59 +0000 (UTC) Date: Wed, 12 May 2021 14:51:58 +0100 To: libstdc++@gcc.gnu.org, gcc-patches@gcc.gnu.org Subject: [committed] libstdc++: Fix some problems in PSTL tests Message-ID: MIME-Version: 1.0 X-Clacks-Overhead: GNU Terry Pratchett X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Disposition: inline X-Spam-Status: No, score=-14.3 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H4, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Jonathan Wakely via Gcc-patches From: Jonathan Wakely Reply-To: Jonathan Wakely Errors-To: gcc-patches-bounces@gcc.gnu.org Sender: "Gcc-patches" 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. Tested x86_64-linux. Committed to trunk. commit d1adbe5c1bd3f3ba098ff112eed9b61515e2dc20 Author: Jonathan Wakely Date: Wed May 12 11:21:51 2021 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. 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 0b950e29396..6e499473963 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 "-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 in(max_n1, [max_n1, bits](std::size_t k) { return T(2 * HashBits(max_n1, bits - 1) ^ 1); }); - Sequence sub(max_n2, [max_n1, bits](std::size_t k) { return T(2 * HashBits(max_n1, bits - 1)); }); + Sequence in(max_n1, [max_n1, bits](std::size_t) { return T(2 * HashBits(max_n1, bits - 1) ^ 1); }); + Sequence 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()); 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 47067379699..6b6fb03e6b6 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 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()); 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_ { template void - operator()(bool is_allow, Op op, Rest&&... rest) + operator()(bool, Op op, Rest&&... rest) { op(std::forward(rest)...); } @@ -787,14 +787,14 @@ struct non_const_wrapper_tagged : non_const_wrapper template typename std::enable_if::value, void>::type - operator()(Policy&& exec, Iterator iter) + operator()(Policy&&, Iterator) { } template typename std::enable_if::value, void>::type - operator()(Policy&& exec, InputIterator input_iter, OutputIterator out_iter) + operator()(Policy&&, InputIterator, OutputIterator) { } }; @@ -999,7 +999,7 @@ struct iterator_invoker { template void - operator()(Rest&&... rest) + operator()(Rest&&...) { } }; @@ -1226,7 +1226,7 @@ test_algo_basic_double(F&& f) template 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(), f);