From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by sourceware.org (Postfix) with ESMTPS id BB8BD385842F for ; Fri, 11 Feb 2022 22:15:55 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org BB8BD385842F Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-644-gelVFxSaOdecQWFKJNgcCA-1; Fri, 11 Feb 2022 17:15:54 -0500 X-MC-Unique: gelVFxSaOdecQWFKJNgcCA-1 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 321758145E0; Fri, 11 Feb 2022 22:15:53 +0000 (UTC) Received: from localhost (unknown [10.33.36.25]) by smtp.corp.redhat.com (Postfix) with ESMTP id B3D415DF4B; Fri, 11 Feb 2022 22:15:52 +0000 (UTC) From: Jonathan Wakely To: libstdc++@gcc.gnu.org, gcc-patches@gcc.gnu.org Subject: [committed] libstdc++: Fix test failures at -O0 Date: Fri, 11 Feb 2022 22:15:51 +0000 Message-Id: <20220211221551.3383447-1-jwakely@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="US-ASCII" X-Spam-Status: No, score=-14.0 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, KAM_NUMSUBJECT, RCVD_IN_DNSWL_LOW, SPF_HELO_NONE, SPF_NONE, TXREP, T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: libstdc++@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libstdc++ mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Feb 2022 22:15:57 -0000 Tested x86_64-linux, pushed to trunk. -- >8 -- libstdc++-v3/ChangeLog: * testsuite/20_util/monotonic_buffer_resource/allocate.cc: Ignore -Walloc-larger-than warning. * testsuite/20_util/unsynchronized_pool_resource/allocate.cc: Likewise. * testsuite/29_atomics/atomic/cons/user_pod.cc: Compile with -O1 to avoid linker error for __atomic_is_lock_free. --- .../testsuite/20_util/monotonic_buffer_resource/allocate.cc | 3 +++ .../testsuite/20_util/unsynchronized_pool_resource/allocate.cc | 3 +++ libstdc++-v3/testsuite/29_atomics/atomic/cons/user_pod.cc | 1 + 3 files changed, 7 insertions(+) diff --git a/libstdc++-v3/testsuite/20_util/monotonic_buffer_resource/allocate.cc b/libstdc++-v3/testsuite/20_util/monotonic_buffer_resource/allocate.cc index 015c1a9e4dc..e7a0e97c9f9 100644 --- a/libstdc++-v3/testsuite/20_util/monotonic_buffer_resource/allocate.cc +++ b/libstdc++-v3/testsuite/20_util/monotonic_buffer_resource/allocate.cc @@ -238,8 +238,11 @@ test07() std::pmr::monotonic_buffer_resource mbr(&cr); try { +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Walloc-size-larger-than=" // Try to allocate a ridiculous size: void* p = mbr.allocate(std::size_t(-2), 1); +#pragma GCC diagnostic pop // Should not reach here! VERIFY( !"attempt to allocate SIZE_MAX-1 should not have succeeded" ); throw p; diff --git a/libstdc++-v3/testsuite/20_util/unsynchronized_pool_resource/allocate.cc b/libstdc++-v3/testsuite/20_util/unsynchronized_pool_resource/allocate.cc index c81344a20e4..25e5ce63b58 100644 --- a/libstdc++-v3/testsuite/20_util/unsynchronized_pool_resource/allocate.cc +++ b/libstdc++-v3/testsuite/20_util/unsynchronized_pool_resource/allocate.cc @@ -281,10 +281,13 @@ test07() std::pmr::unsynchronized_pool_resource upr(&cr); try { +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Walloc-size-larger-than=" // Try to allocate a ridiculous size (and use a large extended alignment // so that careful_resource::do_allocate can distinguish this allocation // from any required for the pool resource's internal data structures): void* p = upr.allocate(std::size_t(-2), 1024); +#pragma GCC distinguish pop // Should not reach here! VERIFY( !"attempt to allocate SIZE_MAX-1 should not have succeeded" ); throw p; diff --git a/libstdc++-v3/testsuite/29_atomics/atomic/cons/user_pod.cc b/libstdc++-v3/testsuite/29_atomics/atomic/cons/user_pod.cc index c538ff370e1..285b420eef1 100644 --- a/libstdc++-v3/testsuite/29_atomics/atomic/cons/user_pod.cc +++ b/libstdc++-v3/testsuite/29_atomics/atomic/cons/user_pod.cc @@ -1,3 +1,4 @@ +// { dg-options "-O1" } // { dg-do link { target c++11 } } // Copyright (C) 2009-2022 Free Software Foundation, Inc. -- 2.34.1