[Lldb-commits] [lldb] 7d26f9e - [test] Allow libc++ namespaces besides `__1`
Jordan Rupprecht via lldb-commits
lldb-commits at lists.llvm.org
Tue Nov 29 04:34:46 PST 2022
Author: Jordan Rupprecht
Date: 2022-11-29T04:34:40-08:00
New Revision: 7d26f9e1329f981ed43eb31f66891702de2f6470
URL: https://github.com/llvm/llvm-project/commit/7d26f9e1329f981ed43eb31f66891702de2f6470
DIFF: https://github.com/llvm/llvm-project/commit/7d26f9e1329f981ed43eb31f66891702de2f6470.diff
LOG: [test] Allow libc++ namespaces besides `__1`
The libc++ data formatter for `std::shared_ptr` allows any namespace, but the test asserts that it must be the default `__1` namespace. Relax the regex to allow anything that looks like `__.*` (although we use `__[^:]*` so we don't match arbitrarily long text).
Reviewed By: labath
Differential Revision: https://reviews.llvm.org/D129898
Added:
Modified:
lldb/test/API/commands/expression/import-std-module/forward_decl_from_module/TestForwardDeclFromStdModule.py
lldb/test/API/functionalities/data-formatter/data-formatter-stl/libcxx/shared_ptr/TestDataFormatterLibcxxSharedPtr.py
Removed:
################################################################################
diff --git a/lldb/test/API/commands/expression/import-std-module/forward_decl_from_module/TestForwardDeclFromStdModule.py b/lldb/test/API/commands/expression/import-std-module/forward_decl_from_module/TestForwardDeclFromStdModule.py
index 943aa5b777252..6adf016727cc8 100644
--- a/lldb/test/API/commands/expression/import-std-module/forward_decl_from_module/TestForwardDeclFromStdModule.py
+++ b/lldb/test/API/commands/expression/import-std-module/forward_decl_from_module/TestForwardDeclFromStdModule.py
@@ -37,4 +37,4 @@ def test(self):
# Both `std::vector` and the type of the member have forward
# declarations before their definitions.
self.expect("expr --raw -- v",
- substrs=['(std::__1::vector<int>) $0 = {', 'f = nullptr', '}'])
+ patterns=[r'\(std::__[^:]*::vector<int>\) \$0 = {', 'f = nullptr', '}'])
diff --git a/lldb/test/API/functionalities/data-formatter/data-formatter-stl/libcxx/shared_ptr/TestDataFormatterLibcxxSharedPtr.py b/lldb/test/API/functionalities/data-formatter/data-formatter-stl/libcxx/shared_ptr/TestDataFormatterLibcxxSharedPtr.py
index 663058e07653c..c646fccc2f5eb 100644
--- a/lldb/test/API/functionalities/data-formatter/data-formatter-stl/libcxx/shared_ptr/TestDataFormatterLibcxxSharedPtr.py
+++ b/lldb/test/API/functionalities/data-formatter/data-formatter-stl/libcxx/shared_ptr/TestDataFormatterLibcxxSharedPtr.py
@@ -68,7 +68,7 @@ def test_shared_ptr_variables(self):
valobj = self.expect_var_path("sp_user", type="std::shared_ptr<User>")
self.assertRegex(
valobj.summary,
- "^std(::__1)?::shared_ptr<User>::element_type @ 0x0*[1-9a-f][0-9a-f]+( strong=1)? weak=1",
+ "^std(::__[^:]*)?::shared_ptr<User>::element_type @ 0x0*[1-9a-f][0-9a-f]+( strong=1)? weak=1",
)
self.assertNotEqual(valobj.child[0].unsigned, 0)
More information about the lldb-commits
mailing list