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 r12-4188] libstdc++: Improve test for printing volatile pointers Date: Tue, 5 Oct 2021 14:57:21 +0000 (GMT) [thread overview] Message-ID: <20211005145721.2B689385AC24@sourceware.org> (raw) https://gcc.gnu.org/g:313193edfc3986c40dedce3d0b41455d0bcdbe43 commit r12-4188-g313193edfc3986c40dedce3d0b41455d0bcdbe43 Author: Jonathan Wakely <jwakely@redhat.com> Date: Tue Oct 5 14:45:11 2021 +0100 libstdc++: Improve test for printing volatile pointers libstdc++-v3/ChangeLog: * testsuite/27_io/basic_ostream/inserters_other/char/volatile_ptr.cc: Check result matches non-volatile pointer. Diff: --- .../27_io/basic_ostream/inserters_other/char/volatile_ptr.cc | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/libstdc++-v3/testsuite/27_io/basic_ostream/inserters_other/char/volatile_ptr.cc b/libstdc++-v3/testsuite/27_io/basic_ostream/inserters_other/char/volatile_ptr.cc index 1b1a9434a95..151e13d3bdd 100644 --- a/libstdc++-v3/testsuite/27_io/basic_ostream/inserters_other/char/volatile_ptr.cc +++ b/libstdc++-v3/testsuite/27_io/basic_ostream/inserters_other/char/volatile_ptr.cc @@ -1,11 +1,15 @@ // { dg-options "-std=gnu++23 -fno-inline" } -// { dg-do link { target c++23 } } +// { dg-do run { target c++23 } } -#include <iostream> +#include <sstream> +#include <testsuite_hooks.h> int main() { int i = 0; - volatile void* p = &i; - std::cout << p << std::endl; + volatile void* vp = &i; + std::ostringstream s1, s2; + s1 << &i; + s2 << vp; + VERIFY( s1.str() == s2.str() ); }
reply other threads:[~2021-10-05 14:57 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=20211005145721.2B689385AC24@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).