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 r11-9925] libstdc++: Fix test failures at -O0 Date: Thu, 21 Apr 2022 15:33:50 +0000 (GMT) [thread overview] Message-ID: <20220421153350.7056238485BC@sourceware.org> (raw) https://gcc.gnu.org/g:6ee9618777c297473d106181ad3079a8bbdc0f37 commit r11-9925-g6ee9618777c297473d106181ad3079a8bbdc0f37 Author: Jonathan Wakely <jwakely@redhat.com> 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. (cherry picked from commit b02247346ea7e403d706b9ccabf9078c060adb9e) 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 40180223bae..a98815d932b 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 a76afbe87a2..fe847dadd27 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 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/29_atomics/atomic/cons/user_pod.cc b/libstdc++-v3/testsuite/29_atomics/atomic/cons/user_pod.cc index 7eab17b12e0..dffdaef7afd 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-2021 Free Software Foundation, Inc.
reply other threads:[~2022-04-21 15:33 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=20220421153350.7056238485BC@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).