Fix make check-debug RUNTESFLAGS=prettyprinters.exp

Message ID 260489d8-4eb4-8b63-8b68-5ba690b65c62@gmail.com
State New
Headers show
Series
  • Fix make check-debug RUNTESFLAGS=prettyprinters.exp
Related show

Commit Message

François Dumont May 4, 2019, 7:31 a.m.
Hi

     This patch allows to run pretty printer tests in _GLIBCXX_DEBUG 
mode. If accepted we could even integrate the pretty printers tests 
within the check-debug target like it is done for the check target.


     * python/libstdcxx/v6/printers.py (add_one_template_type_printer):
     Add type printer for container types in std::__debug namespace.
     * testsuite/lib/gdb-test.exp (whatis-regexp-test): New.
     (gdb-tests): Use distinct parameters for the type of test and use of
     regex.
     (gdb-test): Check for regex test even if 'whatis' test.
     * testsuite/libstdc++-prettyprinters/80276.cc: Adapt for _GLIBCXX_DEBUG
     mode.
     * testsuite/libstdc++-prettyprinters/cxx11.cc: Likewise.
     * testsuite/libstdc++-prettyprinters/cxx17.cc: Likewise.
     * testsuite/libstdc++-prettyprinters/libfundts.cc: Likewise.
     * testsuite/libstdc++-prettyprinters/simple.cc: Likewise.
     * testsuite/libstdc++-prettyprinters/simple11.cc: Likewise.
     * testsuite/libstdc++-prettyprinters/whatis.cc: Likewise.
     * testsuite/libstdc++-prettyprinters/whatis2.cc: Likewise.

     Tested under Linux x86_64 normal and debug modes.

     I only have 1 failure left in both normal and debug modes:

got: type = 
std::unique_ptr<std::vector<std::unique_ptr<std::list<std::__cxx11::basic_string<char, 
std::char_traits<char>, std::allocator<char> >>[]>>[99]>
FAIL: libstdc++-prettyprinters/80276.cc whatis p4

     But I think it is because of the usage of the C++11 abi std::string.

Ok to commit ?

François

Comments

Jonathan Wakely May 4, 2019, 1:14 p.m. | #1
On 04/05/19 09:31 +0200, François Dumont wrote:
>Hi

>

>    This patch allows to run pretty printer tests in _GLIBCXX_DEBUG 

>mode. If accepted we could even integrate the pretty printers tests 

>within the check-debug target like it is done for the check target.

>

>

>    * python/libstdcxx/v6/printers.py (add_one_template_type_printer):

>    Add type printer for container types in std::__debug namespace.

>    * testsuite/lib/gdb-test.exp (whatis-regexp-test): New.

>    (gdb-tests): Use distinct parameters for the type of test and use of

>    regex.

>    (gdb-test): Check for regex test even if 'whatis' test.

>    * testsuite/libstdc++-prettyprinters/80276.cc: Adapt for _GLIBCXX_DEBUG

>    mode.

>    * testsuite/libstdc++-prettyprinters/cxx11.cc: Likewise.

>    * testsuite/libstdc++-prettyprinters/cxx17.cc: Likewise.

>    * testsuite/libstdc++-prettyprinters/libfundts.cc: Likewise.

>    * testsuite/libstdc++-prettyprinters/simple.cc: Likewise.

>    * testsuite/libstdc++-prettyprinters/simple11.cc: Likewise.

>    * testsuite/libstdc++-prettyprinters/whatis.cc: Likewise.

>    * testsuite/libstdc++-prettyprinters/whatis2.cc: Likewise.


Looks good, I'm glad the actual printers.py file isn't made more
complicated to support this.


>    Tested under Linux x86_64 normal and debug modes.

>

>    I only have 1 failure left in both normal and debug modes:

>

>got: type = std::unique_ptr<std::vector<std::unique_ptr<std::list<std::__cxx11::basic_string<char, 

>std::char_traits<char>, std::allocator<char> >>[]>>[99]>

>FAIL: libstdc++-prettyprinters/80276.cc whatis p4

>

>    But I think it is because of the usage of the C++11 abi std::string.


That's https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83906

>Ok to commit ?


OK for trunk, thanks.

Patch

diff --git a/libstdc++-v3/python/libstdcxx/v6/printers.py b/libstdc++-v3/python/libstdcxx/v6/printers.py
index 8f16b53c953..19d367295df 100644
--- a/libstdc++-v3/python/libstdcxx/v6/printers.py
+++ b/libstdc++-v3/python/libstdcxx/v6/printers.py
@@ -1565,6 +1565,11 @@  def add_one_template_type_printer(obj, name, defargs):
     """
     printer = TemplateTypePrinter('std::'+name, defargs)
     gdb.types.register_type_printer(obj, printer)
+
+    # Add type printer for same type in debug namespace:
+    printer = TemplateTypePrinter('std::__debug::'+name, defargs)
+    gdb.types.register_type_printer(obj, printer)
+
     if _versioned_namespace:
         # Add second type printer for same type in versioned namespace:
         ns = 'std::' + _versioned_namespace
diff --git a/libstdc++-v3/testsuite/lib/gdb-test.exp b/libstdc++-v3/testsuite/lib/gdb-test.exp
index a6ae44b8283..bd35d478b7e 100644
--- a/libstdc++-v3/testsuite/lib/gdb-test.exp
+++ b/libstdc++-v3/testsuite/lib/gdb-test.exp
@@ -55,7 +55,7 @@  proc get_line_number {filename marker} {
 proc note-test {var result} {
     global gdb_tests
 
-    lappend gdb_tests $var $result 0
+    lappend gdb_tests $var $result print 0
 }
 
 # A test that uses a regular expression.  This is like note-test, but
@@ -64,14 +64,22 @@  proc note-test {var result} {
 proc regexp-test {var result} {
     global gdb_tests
 
-    lappend gdb_tests $var $result 1
+    lappend gdb_tests $var $result print 1
 }
 
 # A test of 'whatis'.  This tests a type rather than a variable.
 proc whatis-test {var result} {
     global gdb_tests
 
-    lappend gdb_tests $var $result whatis
+    lappend gdb_tests $var $result whatis 0
+}
+
+# A test of 'whatis' that uses a regular expression. This tests a type rather
+# than a variable.
+proc whatis-regexp-test {var result} {
+    global gdb_tests
+
+    lappend gdb_tests $var $result whatis 1
 }
 
 # Utility for testing variable values using gdb, invoked via dg-final.
@@ -136,13 +144,14 @@  proc gdb-test { marker {selector {}} {load_xmethods 0} } {
     puts $fd "info share"
 
     set count 0
-    foreach {var result kind} $gdb_tests {
+    foreach {var result kind rexp} $gdb_tests {
 	incr count
 	set gdb_var($count) $var
 	set gdb_expected($count) $result
 	if {$kind == "whatis"} {
 	    if {$do_whatis_tests} {
 		set gdb_is_type($count) 1
+		set gdb_is_regexp($count) $rexp
 		set gdb_command($count) "whatis $var"
 	    } else {
 	        unsupported "$testname"
@@ -151,7 +160,7 @@  proc gdb-test { marker {selector {}} {load_xmethods 0} } {
 	    }
 	} else {
 	    set gdb_is_type($count) 0
-	    set gdb_is_regexp($count) $kind
+	    set gdb_is_regexp($count) $rexp
 	    set gdb_command($count) "print $var"
 	}
 	puts $fd $gdb_command($count)
@@ -179,9 +188,9 @@  proc gdb-test { marker {selector {}} {load_xmethods 0} } {
 		if {$expect_out(1,string) != "type"} {
 		    error "gdb failure"
 		}
-		set match [expr {![string compare $first \
-				     $gdb_expected($test_counter)]}]
-	    } elseif {$gdb_is_regexp($test_counter)} {
+	    }
+
+	    if {$gdb_is_regexp($test_counter)} {
 		set match [regexp -- $gdb_expected($test_counter) $first]
 	    } else {
 		set match [expr {![string compare $first \
diff --git a/libstdc++-v3/testsuite/libstdc++-prettyprinters/80276.cc b/libstdc++-v3/testsuite/libstdc++-prettyprinters/80276.cc
index fde652e1635..fd67aaf3b70 100644
--- a/libstdc++-v3/testsuite/libstdc++-prettyprinters/80276.cc
+++ b/libstdc++-v3/testsuite/libstdc++-prettyprinters/80276.cc
@@ -41,10 +41,10 @@  main()
   unique_ptr<vector<unique_ptr<set<int>*>>[]> p2;
   unique_ptr<set<unique_ptr<vector<int>*>>[10]> p3;
   unique_ptr<vector<unique_ptr<list<std::string>[]>>[99]> p4;
-  // { dg-final { whatis-test p1 "std::unique_ptr<std::vector<std::unique_ptr<std::vector<int>*>>>" } }
-  // { dg-final { whatis-test p2 "std::unique_ptr<std::vector<std::unique_ptr<std::set<int>*>>\[\]>" } }
-  // { dg-final { whatis-test p3 "std::unique_ptr<std::set<std::unique_ptr<std::vector<int>*>>\[10\]>" } }
-  // { dg-final { whatis-test p4 "std::unique_ptr<std::vector<std::unique_ptr<std::list<std::string>\[\]>>\[99\]>" } }
+  // { dg-final { whatis-regexp-test p1 "std::unique_ptr<std::(__debug::)?vector<std::unique_ptr<std::(__debug::)?vector<int>\\*>>>" } }
+  // { dg-final { whatis-regexp-test p2 "std::unique_ptr<std::(__debug::)?vector<std::unique_ptr<std::(__debug::)?set<int>\\*>>\\\[\\\]>" } }
+  // { dg-final { whatis-regexp-test p3 "std::unique_ptr<std::(__debug::)?set<std::unique_ptr<std::(__debug::)?vector<int>\\*>>\\\[10\\\]>" } }
+  // { dg-final { whatis-regexp-test p4 "std::unique_ptr<std::(__debug::)?vector<std::unique_ptr<std::(__debug::)?list<std::string>\\\[\\\]>>\\\[99\\\]>" } }
 
   placeholder(&p1);		// Mark SPOT
   placeholder(&p2);
diff --git a/libstdc++-v3/testsuite/libstdc++-prettyprinters/cxx11.cc b/libstdc++-v3/testsuite/libstdc++-prettyprinters/cxx11.cc
index 6cb6a5b9555..616413448bc 100644
--- a/libstdc++-v3/testsuite/libstdc++-prettyprinters/cxx11.cc
+++ b/libstdc++-v3/testsuite/libstdc++-prettyprinters/cxx11.cc
@@ -64,65 +64,65 @@  int
 main()
 {
   std::forward_list<int> efl;
-// { dg-final { note-test efl "empty std::forward_list" } }
+// { dg-final { regexp-test efl "empty std::(__debug::)?forward_list" } }
 
   std::forward_list<int> &refl = efl;
-// { dg-final { note-test refl "empty std::forward_list" } }
+// { dg-final { regexp-test refl "empty std::(__debug::)?forward_list" } }
 
   std::forward_list<int> fl;
   fl.push_front(2);
   fl.push_front(1);
-// { dg-final { note-test fl {std::forward_list = {[0] = 1, [1] = 2}} } }
+// { dg-final { regexp-test fl {std::(__debug::)?forward_list = {\[0\] = 1, \[1\] = 2}} } }
 
   std::forward_list<int> &rfl = fl;
-// { dg-final { note-test rfl {std::forward_list = {[0] = 1, [1] = 2}} } }
+// { dg-final { regexp-test rfl {std::(__debug::)?forward_list = {\[0\] = 1, \[1\] = 2}} } }
 
   std::unordered_map<int, std::string> eum;
-// { dg-final { note-test eum "std::unordered_map with 0 elements" } }
+// { dg-final { regexp-test eum "std::(__debug::)?unordered_map with 0 elements" } }
   std::unordered_map<int, std::string> &reum = eum;
-// { dg-final { note-test reum "std::unordered_map with 0 elements" } }
+// { dg-final { regexp-test reum "std::(__debug::)?unordered_map with 0 elements" } }
 
   std::unordered_multimap<int, std::string> eumm;
-// { dg-final { note-test eumm "std::unordered_multimap with 0 elements" } }
+// { dg-final { regexp-test eumm "std::(__debug::)?unordered_multimap with 0 elements" } }
   std::unordered_multimap<int, std::string> &reumm = eumm;
-// { dg-final { note-test reumm "std::unordered_multimap with 0 elements" } }
+// { dg-final { regexp-test reumm "std::(__debug::)?unordered_multimap with 0 elements" } }
 
   std::unordered_set<int> eus;
-// { dg-final { note-test eus "std::unordered_set with 0 elements" } }
+// { dg-final { regexp-test eus "std::(__debug::)?unordered_set with 0 elements" } }
   std::unordered_set<int> &reus = eus;
-// { dg-final { note-test reus "std::unordered_set with 0 elements" } }
+// { dg-final { regexp-test reus "std::(__debug::)?unordered_set with 0 elements" } }
 
   std::unordered_multiset<int> eums;
-// { dg-final { note-test eums "std::unordered_multiset with 0 elements" } }
+// { dg-final { regexp-test eums "std::(__debug::)?unordered_multiset with 0 elements" } }
   std::unordered_multiset<int> &reums = eums;
-// { dg-final { note-test reums "std::unordered_multiset with 0 elements" } }
+// { dg-final { regexp-test reums "std::(__debug::)?unordered_multiset with 0 elements" } }
 
   std::unordered_map<int, std::string> uom;
   uom[5] = "three";
   uom[3] = "seven";
-// { dg-final { note-test uom {std::unordered_map with 2 elements = {[3] = "seven", [5] = "three"}} } }
+// { dg-final { regexp-test uom {std::(__debug::)?unordered_map with 2 elements = {\[3\] = "seven", \[5\] = "three"}} } }
 
   std::unordered_map<int, std::string> &ruom = uom;
-// { dg-final { note-test ruom {std::unordered_map with 2 elements = {[3] = "seven", [5] = "three"}} } }
+// { dg-final { regexp-test ruom {std::(__debug::)?unordered_map with 2 elements = {\[3\] = "seven", \[5\] = "three"}} } }
 
   std::unordered_multimap<int, std::string> uomm;
   uomm.insert(std::pair<int, std::string> (5, "three"));
   uomm.insert(std::pair<int, std::string> (5, "seven"));
-// { dg-final { note-test uomm {std::unordered_multimap with 2 elements = {[5] = "seven", [5] = "three"}} } }
+// { dg-final { regexp-test uomm {std::(__debug::)?unordered_multimap with 2 elements = {\[5\] = "seven", \[5\] = "three"}} } }
   std::unordered_multimap<int, std::string> &ruomm = uomm;
-// { dg-final { note-test ruomm {std::unordered_multimap with 2 elements = {[5] = "seven", [5] = "three"}} } }
+// { dg-final { regexp-test ruomm {std::(__debug::)?unordered_multimap with 2 elements = {\[5\] = "seven", \[5\] = "three"}} } }
 
   std::unordered_set<int> uos;
   uos.insert(5);
-// { dg-final { note-test uos {std::unordered_set with 1 element = {[0] = 5}} } }
+// { dg-final { regexp-test uos {std::(__debug::)?unordered_set with 1 element = {\[0\] = 5}} } }
   std::unordered_set<int> &ruos = uos;
-// { dg-final { note-test ruos {std::unordered_set with 1 element = {[0] = 5}} } }
+// { dg-final { regexp-test ruos {std::(__debug::)?unordered_set with 1 element = {\[0\] = 5}} } }
 
   std::unordered_multiset<int> uoms;
   uoms.insert(5);
-// { dg-final { note-test uoms {std::unordered_multiset with 1 element = {[0] = 5}} } }
+// { dg-final { regexp-test uoms {std::(__debug::)?unordered_multiset with 1 element = {\[0\] = 5}} } }
   std::unordered_multiset<int> &ruoms = uoms;
-// { dg-final { note-test ruoms {std::unordered_multiset with 1 element = {[0] = 5}} } }
+// { dg-final { regexp-test ruoms {std::(__debug::)?unordered_multiset with 1 element = {\[0\] = 5}} } }
 
   std::unique_ptr<datum> uptr (new datum);
   uptr->s = "hi bob";
diff --git a/libstdc++-v3/testsuite/libstdc++-prettyprinters/cxx17.cc b/libstdc++-v3/testsuite/libstdc++-prettyprinters/cxx17.cc
index 4ed4d47240f..4ff462ef519 100644
--- a/libstdc++-v3/testsuite/libstdc++-prettyprinters/cxx17.cc
+++ b/libstdc++-v3/testsuite/libstdc++-prettyprinters/cxx17.cc
@@ -63,7 +63,7 @@  main()
 // { dg-final { note-test op {std::optional<void *> = {[contained value] = 0x0}} } }
   optional<std::map<int, double>> om;
   om = std::map<int, double>{ {1, 2.}, {3, 4.}, {5, 6.} };
-// { dg-final { note-test om {std::optional<std::map<int, double>> containing std::map with 3 elements = {[1] = 2, [3] = 4, [5] = 6}} } }
+// { dg-final { regexp-test om {std::optional<std::(__debug::)?map<int, double>> containing std::(__debug::)?map with 3 elements = {\[1\] = 2, \[3\] = 4, \[5\] = 6}} } }
   optional<std::string> os{ "stringy" };
 // { dg-final { note-test os {std::optional<std::string> = {[contained value] = "stringy"}} } }
 
@@ -80,7 +80,7 @@  main()
   any as2("stringiest");
 // { dg-final { regexp-test as2 {std::any containing const char \* = {\[contained value\] = 0x[[:xdigit:]]+ "stringiest"}} } }
   any am = *om;
-// { dg-final { note-test am {std::any containing std::map with 3 elements = {[1] = 2, [3] = 4, [5] = 6}} } }
+// { dg-final { regexp-test am {std::any containing std::(__debug::)?map with 3 elements = {\[1\] = 2, \[3\] = 4, \[5\] = 6}} } }
   struct local_type { int i = 99; };
   any al = local_type{};
 // { dg-final { note-test al {std::any containing local_type = {[contained value] = {i = 99}}} } }
diff --git a/libstdc++-v3/testsuite/libstdc++-prettyprinters/libfundts.cc b/libstdc++-v3/testsuite/libstdc++-prettyprinters/libfundts.cc
index 7a73d62ab45..f099bd32b3e 100644
--- a/libstdc++-v3/testsuite/libstdc++-prettyprinters/libfundts.cc
+++ b/libstdc++-v3/testsuite/libstdc++-prettyprinters/libfundts.cc
@@ -49,7 +49,7 @@  main()
 // { dg-final { note-test op {std::experimental::optional<void *> = {[contained value] = 0x0}} } }
   optional<std::map<int, double>> om;
   om = std::map<int, double>{ {1, 2.}, {3, 4.}, {5, 6.} };
-// { dg-final { note-test om {std::experimental::optional<std::map<int, double>> containing std::map with 3 elements = {[1] = 2, [3] = 4, [5] = 6}} } }
+// { dg-final { regexp-test om {std::experimental::optional<std::(__debug::)?map<int, double>> containing std::(__debug::)?map with 3 elements = {\[1\] = 2, \[3\] = 4, \[5\] = 6}} } }
   optional<std::string> os{ "stringy" };
 // { dg-final { note-test os {std::experimental::optional<std::string> = {[contained value] = "stringy"}} } }
 
@@ -66,7 +66,7 @@  main()
   any as2("stringiest");
 // { dg-final { regexp-test as2 {std::experimental::any containing const char \* = {\[contained value\] = 0x[[:xdigit:]]+ "stringiest"}} } }
   any am = *om;
-// { dg-final { note-test am {std::experimental::any containing std::map with 3 elements = {[1] = 2, [3] = 4, [5] = 6}} } }
+// { dg-final { regexp-test am {std::experimental::any containing std::(__debug::)?map with 3 elements = {\[1\] = 2, \[3\] = 4, \[5\] = 6}} } }
 
   std::cout << "\n";
   return 0;			// Mark SPOT
diff --git a/libstdc++-v3/testsuite/libstdc++-prettyprinters/simple.cc b/libstdc++-v3/testsuite/libstdc++-prettyprinters/simple.cc
index 5b70e2b3159..453baf8131a 100644
--- a/libstdc++-v3/testsuite/libstdc++-prettyprinters/simple.cc
+++ b/libstdc++-v3/testsuite/libstdc++-prettyprinters/simple.cc
@@ -43,18 +43,18 @@  main()
 
   // PR 65229
   std::bitset<0> bs0;
-// { dg-final { note-test bs0 {std::bitset} } }
+// { dg-final { regexp-test bs0 {std::(__debug::)?bitset} } }
 
   std::bitset<10> bs;
   bs[0] = 1;
   bs[5] = 1;
   bs[7] = 1;
-// { dg-final { note-test bs {std::bitset = {[0] = 1, [5] = 1, [7] = 1}} } }
+// { dg-final { regexp-test bs {std::(__debug::)?bitset = {\[0\] = 1, \[5\] = 1, \[7\] = 1}} } }
 
   std::deque<std::string> deq;
   deq.push_back("one");
   deq.push_back("two");
-// { dg-final { note-test deq {std::deque with 2 elements = {"one", "two"}} } }
+// { dg-final { regexp-test deq {std::(__debug::)?deque with 2 elements = {"one", "two"}} } }
 
   std::deque<int>::iterator deqiter0;
 // { dg-final { note-test deqiter0 {non-dereferenceable iterator for std::deque} } }
@@ -65,7 +65,7 @@  main()
   std::list<std::string> lst;
   lst.push_back("one");
   lst.push_back("two");
-// { dg-final { note-test lst {std::list = {[0] = "one", [1] = "two"}} } }
+// { dg-final { regexp-test lst {std::(__debug::)?list = {\[0\] = "one", \[1\] = "two"}} } }
 
   std::list<int>::iterator lstiter0;
 // { dg-final { note-test lstiter0 {non-dereferenceable iterator for std::list} } }
@@ -80,7 +80,7 @@  main()
 
   std::map<std::string, int> mp;
   mp["zardoz"] = 23;
-// { dg-final { note-test mp {std::map with 1 element = {["zardoz"] = 23}} } }
+// { dg-final { regexp-test mp {std::(__debug::)?map with 1 element = {\["zardoz"\] = 23}} } }
 
   std::map<std::string, int>::iterator mpiter = mp.begin();
 // { dg-final { note-test mpiter {{first = "zardoz", second = 23}} } }
@@ -93,12 +93,12 @@  main()
   intset.insert(2);
   intset.insert(3);
   const std::set<int> const_intset = intset;
-// { dg-final { note-test const_intset {std::set with 2 elements = {[0] = 2, [1] = 3}} } }
+// { dg-final { regexp-test const_intset {std::(__debug::)?set with 2 elements = {\[0\] = 2, \[1\] = 3}} } }
 
   std::set<std::string> sp;
   sp.insert("clownfish");
   sp.insert("barrel");
-// { dg-final { note-test sp {std::set with 2 elements = {[0] = "barrel", [1] = "clownfish"}} } }
+// { dg-final { regexp-test sp {std::(__debug::)?set with 2 elements = {\[0\] = "barrel", \[1\] = "clownfish"}} } }
 
   std::set<std::string>::const_iterator spciter = sp.begin();
 // { dg-final { note-test spciter {"barrel"} } }
@@ -110,7 +110,7 @@  main()
   v.push_back(1);
   v.push_back(2);
   v.erase(v.begin());
-// { dg-final { note-test v {std::vector of length 1, capacity 2 = {2}} } }
+// { dg-final { regexp-test v {std::(__debug::)?vector of length 1, capacity 2 = \\{2\\}} } }
   std::vector<int>::iterator viter3 = v.begin();
 // { dg-final { note-test viter3 {2} } }
 
diff --git a/libstdc++-v3/testsuite/libstdc++-prettyprinters/simple11.cc b/libstdc++-v3/testsuite/libstdc++-prettyprinters/simple11.cc
index d24af91d0ea..6e8c56f44c9 100644
--- a/libstdc++-v3/testsuite/libstdc++-prettyprinters/simple11.cc
+++ b/libstdc++-v3/testsuite/libstdc++-prettyprinters/simple11.cc
@@ -45,12 +45,12 @@  main()
   bs[0] = 1;
   bs[5] = 1;
   bs[7] = 1;
-// { dg-final { note-test bs {std::bitset = {[0] = 1, [5] = 1, [7] = 1}} } }
+// { dg-final { regexp-test bs {std::(__debug::)?bitset = {\[0\] = 1, \[5\] = 1, \[7\] = 1}} } }
 
   std::deque<std::string> deq;
   deq.push_back("one");
   deq.push_back("two");
-// { dg-final { note-test deq {std::deque with 2 elements = {"one", "two"}} } }
+// { dg-final { regexp-test deq {std::(__debug::)?deque with 2 elements = {"one", "two"}} } }
 
   std::deque<std::string>::iterator deqiter = deq.begin();
 // { dg-final { note-test deqiter {"one"} } }
@@ -61,7 +61,7 @@  main()
   std::list<std::string> lst;
   lst.push_back("one");
   lst.push_back("two");
-// { dg-final { note-test lst {std::list = {[0] = "one", [1] = "two"}} } }
+// { dg-final { regexp-test lst {std::(__debug::)?list = {\[0\] = "one", \[1\] = "two"}} } }
 
   std::list<std::string>::iterator lstiter = lst.begin();
   tem = *lstiter;
@@ -76,7 +76,7 @@  main()
 
   std::map<std::string, int> mp;
   mp["zardoz"] = 23;
-// { dg-final { note-test mp {std::map with 1 element = {["zardoz"] = 23}} } }
+// { dg-final { regexp-test mp {std::(__debug::)?map with 1 element = {\["zardoz"\] = 23}} } }
 
   std::map<std::string, int>::iterator mpiter = mp.begin();
 // { dg-final { note-test mpiter {{first = "zardoz", second = 23}} } }
@@ -86,12 +86,12 @@  main()
 
   // PR 67440
   const std::set<int> const_intset = {2, 3};
-// { dg-final { note-test const_intset {std::set with 2 elements = {[0] = 2, [1] = 3}} } }
+// { dg-final { regexp-test const_intset {std::(__debug::)?set with 2 elements = {\[0\] = 2, \[1\] = 3}} } }
 
   std::set<std::string> sp;
   sp.insert("clownfish");
   sp.insert("barrel");
-// { dg-final { note-test sp {std::set with 2 elements = {[0] = "barrel", [1] = "clownfish"}} } }
+// { dg-final { regexp-test sp {std::(__debug::)?set with 2 elements = {\[0\] = "barrel", \[1\] = "clownfish"}} } }
 
   std::set<std::string>::const_iterator spciter = sp.begin();
 // { dg-final { note-test spciter {"barrel"} } }
@@ -103,7 +103,7 @@  main()
   v.push_back(1);
   v.push_back(2);
   v.erase(v.begin());
-// { dg-final { note-test v {std::vector of length 1, capacity 2 = {2}} } }
+// { dg-final { regexp-test v {std::(__debug::)?vector of length 1, capacity 2 = \\{2\\}} } }
   std::vector<int>::iterator viter3 = v.begin();
 // { dg-final { note-test viter3 {2} } }
 
diff --git a/libstdc++-v3/testsuite/libstdc++-prettyprinters/whatis.cc b/libstdc++-v3/testsuite/libstdc++-prettyprinters/whatis.cc
index df17399076e..3f35c53ac46 100644
--- a/libstdc++-v3/testsuite/libstdc++-prettyprinters/whatis.cc
+++ b/libstdc++-v3/testsuite/libstdc++-prettyprinters/whatis.cc
@@ -166,27 +166,27 @@  holder<std::knuth_b> knuth_b_holder;
 
 std::vector<std::deque<std::unique_ptr<char>>> *seq1_ptr;
 holder< std::vector<std::deque<std::unique_ptr<char>>> > seq1_holder;
-// { dg-final { whatis-test seq1_holder "holder<std::vector<std::deque<std::unique_ptr<char>>> >" } }
+// { dg-final { whatis-regexp-test seq1_holder "holder<std::(__debug::)?vector<std::(__debug::)?deque<std::unique_ptr<char>>> >" } }
 
 std::list<std::forward_list<std::unique_ptr<char>>> *seq2_ptr;
 holder< std::list<std::forward_list<std::unique_ptr<char>>> > seq2_holder;
-// { dg-final { whatis-test seq2_holder "holder<std::list<std::forward_list<std::unique_ptr<char>>> >" } }
+// { dg-final { whatis-regexp-test seq2_holder "holder<std::(__debug::)?list<std::(__debug::)?forward_list<std::unique_ptr<char>>> >" } }
 
 std::map<int, std::set<int>> *assoc1_ptr;
 holder< std::map<int, std::set<int>> > assoc1_holder;
-// { dg-final { whatis-test assoc1_holder "holder<std::map<int, std::set<int>> >" } }
+// { dg-final { whatis-regexp-test assoc1_holder "holder<std::(__debug::)?map<int, std::(__debug::)?set<int>> >" } }
 
 std::multimap<int, std::multiset<int>> *assoc2_ptr;
 holder< std::multimap<int, std::multiset<int>> > assoc2_holder;
-// { dg-final { whatis-test assoc2_holder "holder<std::multimap<int, std::multiset<int>> >" } }
+// { dg-final { whatis-regexp-test assoc2_holder "holder<std::(__debug::)?multimap<int, std::(__debug::)?multiset<int>> >" } }
 
 std::unordered_map<int, std::unordered_set<int>> *unord1_ptr;
 holder< std::unordered_map<int, std::unordered_set<int>> > unord1_holder;
-// { dg-final { whatis-test unord1_holder "holder<std::unordered_map<int, std::unordered_set<int>> >" } }
+// { dg-final { whatis-regexp-test unord1_holder "holder<std::(__debug::)?unordered_map<int, std::(__debug::)?unordered_set<int>> >" } }
 
 std::unordered_multimap<int, std::unordered_multiset<int>> *unord2_ptr;
 holder< std::unordered_multimap<int, std::unordered_multiset<int>> > unord2_holder;
-// { dg-final { whatis-test unord2_holder "holder<std::unordered_multimap<int, std::unordered_multiset<int>> >" } }
+// { dg-final { whatis-regexp-test unord2_holder "holder<std::(__debug::)?unordered_multimap<int, std::(__debug::)?unordered_multiset<int>> >" } }
 
 
 int
diff --git a/libstdc++-v3/testsuite/libstdc++-prettyprinters/whatis2.cc b/libstdc++-v3/testsuite/libstdc++-prettyprinters/whatis2.cc
index c774aa3a37c..887e80373e2 100644
--- a/libstdc++-v3/testsuite/libstdc++-prettyprinters/whatis2.cc
+++ b/libstdc++-v3/testsuite/libstdc++-prettyprinters/whatis2.cc
@@ -165,27 +165,27 @@  holder<std::csub_match> csub_match_holder;
 
   std::vector<std::deque<std::unique_ptr<char>>> *seq1_ptr;
   holder< std::vector<std::deque<std::unique_ptr<char>>> > seq1_holder;
-// { dg-final { whatis-test seq1_holder "holder<std::vector<std::deque<std::unique_ptr<char>>> >" } }
+// { dg-final { whatis-regexp-test seq1_holder "holder<std::(__debug::)?vector<std::(__debug::)?deque<std::unique_ptr<char>>> >" } }
 
   std::list<std::forward_list<std::unique_ptr<char>>> *seq2_ptr;
   holder< std::list<std::forward_list<std::unique_ptr<char>>> > seq2_holder;
-// { dg-final { whatis-test seq2_holder "holder<std::list<std::forward_list<std::unique_ptr<char>>> >" } }
+// { dg-final { whatis-regexp-test seq2_holder "holder<std::(__debug::)?list<std::(__debug::)?forward_list<std::unique_ptr<char>>> >" } }
 
   std::map<int, std::set<int>> *assoc1_ptr;
   holder< std::map<int, std::set<int>> > assoc1_holder;
-// { dg-final { whatis-test assoc1_holder "holder<std::map<int, std::set<int>> >" } }
+// { dg-final { whatis-regexp-test assoc1_holder "holder<std::(__debug::)?map<int, std::(__debug::)?set<int>> >" } }
 
   std::multimap<int, std::multiset<int>> *assoc2_ptr;
   holder< std::multimap<int, std::multiset<int>> > assoc2_holder;
-// { dg-final { whatis-test assoc2_holder "holder<std::multimap<int, std::multiset<int>> >" } }
+// { dg-final { whatis-regexp-test assoc2_holder "holder<std::(__debug::)?multimap<int, std::(__debug::)?multiset<int>> >" } }
 
   std::unordered_map<int, std::unordered_set<int>> *unord1_ptr;
   holder< std::unordered_map<int, std::unordered_set<int>> > unord1_holder;
-// { dg-final { whatis-test unord1_holder "holder<std::unordered_map<int, std::unordered_set<int>> >" } }
+// { dg-final { whatis-regexp-test unord1_holder "holder<std::(__debug::)?unordered_map<int, std::(__debug::)?unordered_set<int>> >" } }
 
   std::unordered_multimap<int, std::unordered_multiset<int>> *unord2_ptr;
   holder< std::unordered_multimap<int, std::unordered_multiset<int>> > unord2_holder;
-// { dg-final { whatis-test unord2_holder "holder<std::unordered_multimap<int, std::unordered_multiset<int>> >" } }
+// { dg-final { whatis-regexp-test unord2_holder "holder<std::(__debug::)?unordered_multimap<int, std::(__debug::)?unordered_multiset<int>> >" } }
 
 
   placeholder(&ios_ptr);		// Mark SPOT