[libcxx-commits] [libcxx] 9904bcf - [libc++] Fix GDB pretty printer tests for older Clangs and GCC

Louis Dionne via libcxx-commits libcxx-commits at lists.llvm.org
Wed Nov 3 10:02:09 PDT 2021


Author: Louis Dionne
Date: 2021-11-03T13:02:04-04:00
New Revision: 9904bcf2a4878f3e3f0c0d1ef7ba796ccef1a021

URL: https://github.com/llvm/llvm-project/commit/9904bcf2a4878f3e3f0c0d1ef7ba796ccef1a021
DIFF: https://github.com/llvm/llvm-project/commit/9904bcf2a4878f3e3f0c0d1ef7ba796ccef1a021.diff

LOG: [libc++] Fix GDB pretty printer tests for older Clangs and GCC

This was missed by https://llvm.org/D111477, which broke the CI.

Differential Revision: https://reviews.llvm.org/D113112

Added: 
    

Modified: 
    libcxx/test/libcxx/gdb/gdb_pretty_printer_test.sh.cpp

Removed: 
    


################################################################################
diff  --git a/libcxx/test/libcxx/gdb/gdb_pretty_printer_test.sh.cpp b/libcxx/test/libcxx/gdb/gdb_pretty_printer_test.sh.cpp
index f918cf841b320..2c53bd1d11078 100644
--- a/libcxx/test/libcxx/gdb/gdb_pretty_printer_test.sh.cpp
+++ b/libcxx/test/libcxx/gdb/gdb_pretty_printer_test.sh.cpp
@@ -43,7 +43,7 @@
 //
 //    Or
 //
-//    Call ComparePrettyPrintToChars with that variable, and a "const char*"
+//    Call ComparePrettyPrintToRegex with that variable, and a "const char*"
 //    *python* regular expression to match against the printer's output.
 //    The set of special characters in a Python regular expression overlaps
 //    with a lot of things the pretty printers print--brackets, for
@@ -244,22 +244,22 @@ void unique_ptr_test() {
 
 void bitset_test() {
   std::bitset<258> i_am_empty(0);
-  ComparePrettyPrintToChars(i_am_empty, "std::bitset<258ul>");
+  ComparePrettyPrintToRegex(i_am_empty, "std::bitset<258(ul)?>");
 
   std::bitset<0> very_empty;
-  ComparePrettyPrintToChars(very_empty, "std::bitset<0ul>");
+  ComparePrettyPrintToRegex(very_empty, "std::bitset<0(ul)?>");
 
   std::bitset<15> b_000001111111100(1020);
-  ComparePrettyPrintToChars(b_000001111111100,
-      "std::bitset<15ul> = {[2] = 1, [3] = 1, [4] = 1, [5] = 1, [6] = 1, "
-      "[7] = 1, [8] = 1, [9] = 1}");
+  ComparePrettyPrintToRegex(b_000001111111100,
+      R"(std::bitset<15(ul)?> = {\[2\] = 1, \[3\] = 1, \[4\] = 1, \[5\] = 1, \[6\] = 1, )"
+      R"(\[7\] = 1, \[8\] = 1, \[9\] = 1})");
 
   std::bitset<258> b_0_129_132(0);
   b_0_129_132[0] = true;
   b_0_129_132[129] = true;
   b_0_129_132[132] = true;
-  ComparePrettyPrintToChars(b_0_129_132,
-      "std::bitset<258ul> = {[0] = 1, [129] = 1, [132] = 1}");
+  ComparePrettyPrintToRegex(b_0_129_132,
+      R"(std::bitset<258(ul)?> = {\[0\] = 1, \[129\] = 1, \[132\] = 1})");
 }
 
 void list_test() {


        


More information about the libcxx-commits mailing list