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):
2323
2424 self .runCmd ("settings set target.import-std-module true" )
2525
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+
2633 size_type = "size_type"
2734 value_type = "value_type"
2835 iterator = "iterator"
@@ -34,14 +41,13 @@ def test(self):
3441 ValueCheck (name = "current" ),
3542 ]
3643
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" )]),
4551 ],
4652 )
4753
Original file line number Diff line number Diff line change @@ -17,26 +17,42 @@ def test(self):
1717 self , "// Set break point at this line." , lldb .SBFileSpec ("main.cpp" )
1818 )
1919
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+
2031 size_type = "size_type"
2132 value_type = "value_type"
2233
2334 self .runCmd ("settings set target.import-std-module true" )
2435
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+ ),
4056 ],
4157 )
4258 self .expect_expr ("a.size()" , result_type = size_type , result_value = "2" )
You can’t perform that action at this time.
0 commit comments