Skip to content

Commit 7e6d277

Browse files
committed
[lldb][test] TestStructuredBinding.py: adjust assertion to check for compatible compiler version
Requires a compiler with the changes in #122265
1 parent 86ba198 commit 7e6d277

File tree

1 file changed

+18
-13
lines changed

1 file changed

+18
-13
lines changed

lldb/test/API/lang/cpp/structured-binding/TestStructuredBinding.py

Lines changed: 18 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -99,16 +99,21 @@ def test(self):
9999
self.expect_expr("ty2", result_value="'z'")
100100
self.expect_expr("tz2", result_value="10")
101101

102-
self.expect(
103-
"frame variable",
104-
substrs=[
105-
"tx1 =",
106-
"ty1 =",
107-
"tz1 =",
108-
"tx2 =",
109-
"ty2 =",
110-
"tz2 =",
111-
"mp1 =",
112-
"mp2 =",
113-
],
114-
)
102+
# Older versions of Clang marked structured binding variables
103+
# as artificial, and thus LLDB wouldn't display them.
104+
if self.expectedCompiler(["clang"]) and self.expectedCompilerVersion(
105+
[">=", "22.0"]
106+
):
107+
self.expect(
108+
"frame variable",
109+
substrs=[
110+
"tx1 =",
111+
"ty1 =",
112+
"tz1 =",
113+
"tx2 =",
114+
"ty2 =",
115+
"tz2 =",
116+
"mp1 =",
117+
"mp2 =",
118+
],
119+
)

0 commit comments

Comments
 (0)