libstdc++: Improve test for printing volatile pointers
authorJonathan Wakely <jwakely@redhat.com>
Tue, 5 Oct 2021 13:45:11 +0000 (14:45 +0100)
committerJonathan Wakely <jwakely@redhat.com>
Tue, 5 Oct 2021 14:56:55 +0000 (15:56 +0100)
libstdc++-v3/ChangeLog:

* testsuite/27_io/basic_ostream/inserters_other/char/volatile_ptr.cc:
Check result matches non-volatile pointer.

libstdc++-v3/testsuite/27_io/basic_ostream/inserters_other/char/volatile_ptr.cc

index 1b1a943..151e13d 100644 (file)
@@ -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() );
 }