File tree Expand file tree Collapse file tree 2 files changed +45
-23
lines changed
lldb/test/API/commands/expression/import-std-module Expand file tree Collapse file tree 2 files changed +45
-23
lines changed Original file line number Diff line number Diff line change @@ -23,6 +23,13 @@ def test(self):
23
23
24
24
self .runCmd ("settings set target.import-std-module true" )
25
25
26
+ if self .expectedCompiler (["clang" ]) and self .expectedCompilerVersion (
27
+ [">" , "16.0" ]
28
+ ):
29
+ vector_type = "std::vector<Foo>"
30
+ else :
31
+ vector_type = "std::vector<Foo, std::allocator<Foo> >"
32
+
26
33
size_type = "size_type"
27
34
value_type = "value_type"
28
35
iterator = "iterator"
@@ -34,14 +41,13 @@ def test(self):
34
41
ValueCheck (name = "current" ),
35
42
]
36
43
37
- self .expect (
38
- "expr a" ,
39
- patterns = [
40
- """\(std::vector<Foo(, std::allocator<Foo> )*>\) \$0 = size=3 \{
41
- \[0\] = \(a = 3\)
42
- \[1\] = \(a = 1\)
43
- \[2\] = \(a = 2\)
44
- \}"""
44
+ self .expect_expr (
45
+ "a" ,
46
+ result_type = vector_type ,
47
+ result_children = [
48
+ ValueCheck (children = [ValueCheck (value = "3" )]),
49
+ ValueCheck (children = [ValueCheck (value = "1" )]),
50
+ ValueCheck (children = [ValueCheck (value = "2" )]),
45
51
],
46
52
)
47
53
Original file line number Diff line number Diff line change @@ -17,26 +17,42 @@ def test(self):
17
17
self , "// Set break point at this line." , lldb .SBFileSpec ("main.cpp" )
18
18
)
19
19
20
+ if self .expectedCompiler (["clang" ]) and self .expectedCompilerVersion (
21
+ [">" , "16.0" ]
22
+ ):
23
+ vector_type = "std::vector<int>"
24
+ vector_of_vector_type = "std::vector<std::vector<int> >"
25
+ else :
26
+ vector_type = "std::vector<int>"
27
+ vector_of_vector_type = (
28
+ "std::vector<std::vector<int>, std::allocator<std::vector<int> > >"
29
+ )
30
+
20
31
size_type = "size_type"
21
32
value_type = "value_type"
22
33
23
34
self .runCmd ("settings set target.import-std-module true" )
24
35
25
- self .expect (
26
- "expr a" ,
27
- patterns = [
28
- """\(std::vector<std::vector<int>(, std::allocator<std::vector<int> )* >\) \$0 = size=2 \{
29
- \[0\] = size=3 \{
30
- \[0\] = 1
31
- \[1\] = 2
32
- \[2\] = 3
33
- \}
34
- \[1\] = size=3 \{
35
- \[0\] = 3
36
- \[1\] = 2
37
- \[2\] = 1
38
- \}
39
- \}"""
36
+ self .expect_expr (
37
+ "a" ,
38
+ result_type = vector_of_vector_type ,
39
+ result_children = [
40
+ ValueCheck (
41
+ type = vector_type ,
42
+ children = [
43
+ ValueCheck (value = "1" ),
44
+ ValueCheck (value = "2" ),
45
+ ValueCheck (value = "3" ),
46
+ ],
47
+ ),
48
+ ValueCheck (
49
+ type = vector_type ,
50
+ children = [
51
+ ValueCheck (value = "3" ),
52
+ ValueCheck (value = "2" ),
53
+ ValueCheck (value = "1" ),
54
+ ],
55
+ ),
40
56
],
41
57
)
42
58
self .expect_expr ("a.size()" , result_type = size_type , result_value = "2" )
You can’t perform that action at this time.
0 commit comments