Skip to content

Revert "[lldb][test] Remove compiler version check and use regex" #124101

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 23, 2025

Conversation

Michael137
Copy link
Member

Reverts #123393

This is causing TestVectorOfVectorsFromStdModule.py to fail on the the macOS clang-15 matrix bot.

@Michael137 Michael137 merged commit 4bcdb26 into main Jan 23, 2025
5 of 6 checks passed
@Michael137 Michael137 deleted the revert-123393-fix_lldb_vector_test branch January 23, 2025 11:29
@llvmbot llvmbot added the lldb label Jan 23, 2025
@llvmbot
Copy link
Member

llvmbot commented Jan 23, 2025

@llvm/pr-subscribers-lldb

Author: Michael Buch (Michael137)

Changes

Reverts llvm/llvm-project#123393

This is causing TestVectorOfVectorsFromStdModule.py to fail on the the macOS clang-15 matrix bot.


Full diff: https://github.com/llvm/llvm-project/pull/124101.diff

2 Files Affected:

  • (modified) lldb/test/API/commands/expression/import-std-module/vector-dbg-info-content/TestDbgInfoContentVectorFromStdModule.py (+14-8)
  • (modified) lldb/test/API/commands/expression/import-std-module/vector-of-vectors/TestVectorOfVectorsFromStdModule.py (+31-15)
diff --git a/lldb/test/API/commands/expression/import-std-module/vector-dbg-info-content/TestDbgInfoContentVectorFromStdModule.py b/lldb/test/API/commands/expression/import-std-module/vector-dbg-info-content/TestDbgInfoContentVectorFromStdModule.py
index 759077302bfca4..1c32222e64f14c 100644
--- a/lldb/test/API/commands/expression/import-std-module/vector-dbg-info-content/TestDbgInfoContentVectorFromStdModule.py
+++ b/lldb/test/API/commands/expression/import-std-module/vector-dbg-info-content/TestDbgInfoContentVectorFromStdModule.py
@@ -23,6 +23,13 @@ def test(self):
 
         self.runCmd("settings set target.import-std-module true")
 
+        if self.expectedCompiler(["clang"]) and self.expectedCompilerVersion(
+            [">", "16.0"]
+        ):
+            vector_type = "std::vector<Foo>"
+        else:
+            vector_type = "std::vector<Foo, std::allocator<Foo> >"
+
         size_type = "size_type"
         value_type = "value_type"
         iterator = "iterator"
@@ -34,14 +41,13 @@ def test(self):
             ValueCheck(name="current"),
         ]
 
-        self.expect(
-            "expr a",
-            patterns=[
-                """\(std::vector<Foo(, std::allocator<Foo> )*>\) \$0 = size=3 \{
-  \[0\] = \(a = 3\)
-  \[1\] = \(a = 1\)
-  \[2\] = \(a = 2\)
-\}"""
+        self.expect_expr(
+            "a",
+            result_type=vector_type,
+            result_children=[
+                ValueCheck(children=[ValueCheck(value="3")]),
+                ValueCheck(children=[ValueCheck(value="1")]),
+                ValueCheck(children=[ValueCheck(value="2")]),
             ],
         )
 
diff --git a/lldb/test/API/commands/expression/import-std-module/vector-of-vectors/TestVectorOfVectorsFromStdModule.py b/lldb/test/API/commands/expression/import-std-module/vector-of-vectors/TestVectorOfVectorsFromStdModule.py
index e18785ec1359cc..a1f33271f39d2f 100644
--- a/lldb/test/API/commands/expression/import-std-module/vector-of-vectors/TestVectorOfVectorsFromStdModule.py
+++ b/lldb/test/API/commands/expression/import-std-module/vector-of-vectors/TestVectorOfVectorsFromStdModule.py
@@ -17,26 +17,42 @@ def test(self):
             self, "// Set break point at this line.", lldb.SBFileSpec("main.cpp")
         )
 
+        if self.expectedCompiler(["clang"]) and self.expectedCompilerVersion(
+            [">", "16.0"]
+        ):
+            vector_type = "std::vector<int>"
+            vector_of_vector_type = "std::vector<std::vector<int> >"
+        else:
+            vector_type = "std::vector<int>"
+            vector_of_vector_type = (
+                "std::vector<std::vector<int>, std::allocator<std::vector<int> > >"
+            )
+
         size_type = "size_type"
         value_type = "value_type"
 
         self.runCmd("settings set target.import-std-module true")
 
-        self.expect(
-            "expr a",
-            patterns=[
-                """\(std::vector<std::vector<int>(, std::allocator<std::vector<int> )* >\) \$0 = size=2 \{
-  \[0\] = size=3 \{
-    \[0\] = 1
-    \[1\] = 2
-    \[2\] = 3
-  \}
-  \[1\] = size=3 \{
-    \[0\] = 3
-    \[1\] = 2
-    \[2\] = 1
-  \}
-\}"""
+        self.expect_expr(
+            "a",
+            result_type=vector_of_vector_type,
+            result_children=[
+                ValueCheck(
+                    type=vector_type,
+                    children=[
+                        ValueCheck(value="1"),
+                        ValueCheck(value="2"),
+                        ValueCheck(value="3"),
+                    ],
+                ),
+                ValueCheck(
+                    type=vector_type,
+                    children=[
+                        ValueCheck(value="3"),
+                        ValueCheck(value="2"),
+                        ValueCheck(value="1"),
+                    ],
+                ),
             ],
         )
         self.expect_expr("a.size()", result_type=size_type, result_value="2")

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants