From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2181) id 4A696385841B; Fri, 11 Feb 2022 22:15:06 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 4A696385841B MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="utf-8" From: Jonathan Wakely To: gcc-cvs@gcc.gnu.org, libstdc++-cvs@gcc.gnu.org Subject: [gcc r12-7203] libstdc++: Fix test failures at -O0 X-Act-Checkin: gcc X-Git-Author: Jonathan Wakely X-Git-Refname: refs/heads/master X-Git-Oldrev: 9355a8c35883b5125851bb9b4169a1a1cd8e343f X-Git-Newrev: b02247346ea7e403d706b9ccabf9078c060adb9e Message-Id: <20220211221506.4A696385841B@sourceware.org> Date: Fri, 11 Feb 2022 22:15:06 +0000 (GMT) X-BeenThere: libstdc++-cvs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libstdc++-cvs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Feb 2022 22:15:06 -0000 https://gcc.gnu.org/g:b02247346ea7e403d706b9ccabf9078c060adb9e commit r12-7203-gb02247346ea7e403d706b9ccabf9078c060adb9e Author: Jonathan Wakely Date: Fri Feb 11 21:17:05 2022 +0000 libstdc++: Fix test failures at -O0 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. Diff: --- libstdc++-v3/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.