diff options
author | Jonathan Wakely <jwakely@redhat.com> | 2021-10-05 14:45:11 +0100 |
---|---|---|
committer | Jonathan Wakely <jwakely@redhat.com> | 2021-10-05 15:56:55 +0100 |
commit | 313193edfc3986c40dedce3d0b41455d0bcdbe43 (patch) | |
tree | b268b46eaf395b6021bdfb80494ca6281db08c2c | |
parent | d4f6dbe18374385b8199ca3d6121e37a1189b589 (diff) | |
download | gcc-313193edfc3986c40dedce3d0b41455d0bcdbe43.zip gcc-313193edfc3986c40dedce3d0b41455d0bcdbe43.tar.gz gcc-313193edfc3986c40dedce3d0b41455d0bcdbe43.tar.bz2 |
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.
-rw-r--r-- | libstdc++-v3/testsuite/27_io/basic_ostream/inserters_other/char/volatile_ptr.cc | 12 |
1 files 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 1b1a943..151e13d 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() ); } |