2 from lldbsuite
.test
.decorators
import *
3 from lldbsuite
.test
.lldbtest
import *
4 from lldbsuite
.test
import lldbutil
7 class TestStructuredBinding(TestBase
):
8 @skipIf(oslist
=["linux"], archs
=["arm"])
9 @skipIf(compiler
="clang", compiler_version
=["<", "14.0"])
12 lldbutil
.run_to_source_breakpoint(
13 self
, "// break here", lldb
.SBFileSpec("main.cpp")
20 ValueCheck(name
="x", type="int"),
21 ValueCheck(name
="y", type="int"),
24 self
.expect_expr("b1", result_type
="char", result_value
="'a'")
25 self
.expect_expr("c1", result_type
="char", result_value
="'b'")
26 self
.expect_expr("d1", result_type
="short", result_value
="50")
27 self
.expect_expr("e1", result_type
="int", result_value
="60")
28 self
.expect_expr("f1", result_type
="char", result_value
="'c'")
34 ValueCheck(name
="x", type="int"),
35 ValueCheck(name
="y", type="int"),
38 self
.expect_expr("b2", result_type
="char", result_value
="'a'")
39 self
.expect_expr("c2", result_type
="char", result_value
="'b'")
40 self
.expect_expr("d2", result_type
="short", result_value
="50")
41 self
.expect_expr("e2", result_type
="int", result_value
="60")
42 self
.expect_expr("f2", result_type
="char", result_value
="'c'")
48 ValueCheck(name
="x", type="int"),
49 ValueCheck(name
="y", type="int"),
52 self
.expect_expr("b3", result_type
="char", result_value
="'a'")
53 self
.expect_expr("c3", result_type
="char", result_value
="'b'")
54 self
.expect_expr("d3", result_type
="short", result_value
="50")
55 self
.expect_expr("e3", result_type
="int", result_value
="60")
56 self
.expect_expr("f3", result_type
="char", result_value
="'c'")
58 self
.expect_expr("carr_ref1", result_type
="char", result_value
="'a'")
59 self
.expect_expr("carr_ref2", result_type
="char", result_value
="'b'")
60 self
.expect_expr("carr_ref3", result_type
="char", result_value
="'c'")
62 self
.expect_expr("sarr_ref1", result_type
="short", result_value
="11")
63 self
.expect_expr("sarr_ref2", result_type
="short", result_value
="12")
64 self
.expect_expr("sarr_ref3", result_type
="short", result_value
="13")
66 self
.expect_expr("iarr_ref1", result_type
="int", result_value
="22")
67 self
.expect_expr("iarr_ref2", result_type
="int", result_value
="33")
68 self
.expect_expr("iarr_ref3", result_type
="int", result_value
="44")
70 self
.expect_expr("carr_rref1", result_type
="char", result_value
="'a'")
71 self
.expect_expr("carr_rref2", result_type
="char", result_value
="'b'")
72 self
.expect_expr("carr_rref3", result_type
="char", result_value
="'c'")
74 self
.expect_expr("sarr_rref1", result_type
="short", result_value
="11")
75 self
.expect_expr("sarr_rref2", result_type
="short", result_value
="12")
76 self
.expect_expr("sarr_rref3", result_type
="short", result_value
="13")
78 self
.expect_expr("iarr_rref1", result_type
="int", result_value
="22")
79 self
.expect_expr("iarr_rref2", result_type
="int", result_value
="33")
80 self
.expect_expr("iarr_rref3", result_type
="int", result_value
="44")
82 self
.expect_expr("carr_copy1", result_type
="char", result_value
="'a'")
83 self
.expect_expr("carr_copy2", result_type
="char", result_value
="'b'")
84 self
.expect_expr("carr_copy3", result_type
="char", result_value
="'c'")
86 self
.expect_expr("sarr_copy1", result_type
="short", result_value
="11")
87 self
.expect_expr("sarr_copy2", result_type
="short", result_value
="12")
88 self
.expect_expr("sarr_copy3", result_type
="short", result_value
="13")
90 self
.expect_expr("iarr_copy1", result_type
="int", result_value
="22")
91 self
.expect_expr("iarr_copy2", result_type
="int", result_value
="33")
92 self
.expect_expr("iarr_copy3", result_type
="int", result_value
="44")
94 self
.expect_expr("tx1", result_value
="4")
95 self
.expect_expr("ty1", result_value
="'z'")
96 self
.expect_expr("tz1", result_value
="10")
98 self
.expect_expr("tx2", result_value
="4")
99 self
.expect_expr("ty2", result_value
="'z'")
100 self
.expect_expr("tz2", result_value
="10")