Skip to content

Commit ad81d01

Browse files
committed
[lldb][Test] Check compiler in data forammter compiler version checks
**Summary** The compiler version check wouldn't make sense for non-GCC compilers, so check for the compiler too. Differential Revision: https://reviews.llvm.org/D143656
1 parent 1ba6ec0 commit ad81d01

File tree

17 files changed

+19
-19
lines changed

17 files changed

+19
-19
lines changed

lldb/test/API/commands/expression/import-std-module/deque-basic/TestDequeFromStdModule.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ def test(self):
2020

2121
self.runCmd("settings set target.import-std-module true")
2222

23-
if self.expectedCompilerVersion(['>', '16.0']):
23+
if self.expectedCompiler(["clang"]) and self.expectedCompilerVersion(['>', '16.0']):
2424
deque_type = "std::deque<int>"
2525
else:
2626
deque_type = "std::deque<int, std::allocator<int> >"

lldb/test/API/commands/expression/import-std-module/deque-dbg-info-content/TestDbgInfoContentDequeFromStdModule.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ def test(self):
2121

2222
self.runCmd("settings set target.import-std-module true")
2323

24-
if self.expectedCompilerVersion(['>', '16.0']):
24+
if self.expectedCompiler(["clang"]) and self.expectedCompilerVersion(['>', '16.0']):
2525
deque_type = "std::deque<Foo>"
2626
else:
2727
deque_type = "std::deque<Foo, std::allocator<Foo> >"

lldb/test/API/commands/expression/import-std-module/forward_list-dbg-info-content/TestDbgInfoContentForwardListFromStdModule.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ def test(self):
2020

2121
self.runCmd("settings set target.import-std-module true")
2222

23-
if self.expectedCompilerVersion(['>', '16.0']):
23+
if self.expectedCompiler(["clang"]) and self.expectedCompilerVersion(['>', '16.0']):
2424
list_type = "std::forward_list<Foo>"
2525
else:
2626
list_type = "std::forward_list<Foo, std::allocator<Foo> >"

lldb/test/API/commands/expression/import-std-module/forward_list/TestForwardListFromStdModule.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ def test(self):
2020

2121
self.runCmd("settings set target.import-std-module true")
2222

23-
if self.expectedCompilerVersion(['>', '16.0']):
23+
if self.expectedCompiler(["clang"]) and self.expectedCompilerVersion(['>', '16.0']):
2424
list_type = "std::forward_list<int>"
2525
else:
2626
list_type = "std::forward_list<int, std::allocator<int> >"

lldb/test/API/commands/expression/import-std-module/list-dbg-info-content/TestDbgInfoContentListFromStdModule.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ def test(self):
2222

2323
self.runCmd("settings set target.import-std-module true")
2424

25-
if self.expectedCompilerVersion(['>', '16.0']):
25+
if self.expectedCompiler(["clang"]) and self.expectedCompilerVersion(['>', '16.0']):
2626
list_type = "std::list<Foo>"
2727
else:
2828
list_type = "std::list<Foo, std::allocator<Foo> >"

lldb/test/API/commands/expression/import-std-module/list/TestListFromStdModule.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ def test(self):
2020

2121
self.runCmd("settings set target.import-std-module true")
2222

23-
if self.expectedCompilerVersion(['>', '16.0']):
23+
if self.expectedCompiler(["clang"]) and self.expectedCompilerVersion(['>', '16.0']):
2424
list_type = "std::list<int>"
2525
else:
2626
list_type = "std::list<int, std::allocator<int> >"

lldb/test/API/commands/expression/import-std-module/non-module-type-separation/TestNonModuleTypeSeparation.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ def test(self):
3131
ValueCheck(value="2"),
3232
]
3333

34-
if self.expectedCompilerVersion(['>', '16.0']):
34+
if self.expectedCompiler(["clang"]) and self.expectedCompilerVersion(['>', '16.0']):
3535
vector_type = "std::vector<int>"
3636
dbg_vec_type = "std::vector<DbgInfoClass>"
3737
module_vector_type = "std::vector<int>"

lldb/test/API/commands/expression/import-std-module/queue/TestQueueFromStdModule.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ def test(self):
2020

2121
self.runCmd("settings set target.import-std-module true")
2222

23-
if self.expectedCompilerVersion(['>', '16.0']):
23+
if self.expectedCompiler(["clang"]) and self.expectedCompilerVersion(['>', '16.0']):
2424
queue_type = "std::queue<C>"
2525
else:
2626
queue_type = "std::queue<C, std::deque<C, std::allocator<C> > >"
@@ -56,7 +56,7 @@ def test(self):
5656
result_value="5")
5757

5858
# Test std::queue functionality with a std::list.
59-
if self.expectedCompilerVersion(['>', '16.0']):
59+
if self.expectedCompiler(["clang"]) and self.expectedCompilerVersion(['>', '16.0']):
6060
queue_type = "std::queue<C, std::list<C> >"
6161
else:
6262
queue_type = "std::queue<C, std::list<C, std::allocator<C> > >"

lldb/test/API/commands/expression/import-std-module/retry-with-std-module/TestRetryWithStdModule.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ def test(self):
1414
"// Set break point at this line.",
1515
lldb.SBFileSpec("main.cpp"))
1616

17-
if self.expectedCompilerVersion(['>', '16.0']):
17+
if self.expectedCompiler(["clang"]) and self.expectedCompilerVersion(['>', '16.0']):
1818
vec_type = "std::vector<int>"
1919
else:
2020
vec_type = "std::vector<int, std::allocator<int> >"

lldb/test/API/commands/expression/import-std-module/unique_ptr-dbg-info-content/TestUniquePtrDbgInfoContent.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ def test(self):
2222

2323
self.runCmd("settings set target.import-std-module true")
2424

25-
if self.expectedCompilerVersion(['>', '16.0']):
25+
if self.expectedCompiler(["clang"]) and self.expectedCompilerVersion(['>', '16.0']):
2626
ptr_type = "std::unique_ptr<Foo>"
2727
else:
2828
ptr_type = "std::unique_ptr<Foo, std::default_delete<Foo> >"

lldb/test/API/commands/expression/import-std-module/unique_ptr/TestUniquePtrFromStdModule.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ def test(self):
2222

2323
self.runCmd("settings set target.import-std-module true")
2424

25-
if self.expectedCompilerVersion(['>', '16.0']):
25+
if self.expectedCompiler(["clang"]) and self.expectedCompilerVersion(['>', '16.0']):
2626
ptr_type = "std::unique_ptr<int>"
2727
else:
2828
ptr_type = "std::unique_ptr<int, std::default_delete<int> >"

lldb/test/API/commands/expression/import-std-module/vector-dbg-info-content/TestDbgInfoContentVectorFromStdModule.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ def test(self):
2222

2323
self.runCmd("settings set target.import-std-module true")
2424

25-
if self.expectedCompilerVersion(['>', '16.0']):
25+
if self.expectedCompiler(["clang"]) and self.expectedCompilerVersion(['>', '16.0']):
2626
vector_type = "std::vector<Foo>"
2727
else:
2828
vector_type = "std::vector<Foo, std::allocator<Foo> >"

lldb/test/API/commands/expression/import-std-module/vector-of-vectors/TestVectorOfVectorsFromStdModule.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ def test(self):
1818
"// Set break point at this line.",
1919
lldb.SBFileSpec("main.cpp"))
2020

21-
if self.expectedCompilerVersion(['>', '16.0']):
21+
if self.expectedCompiler(["clang"]) and self.expectedCompilerVersion(['>', '16.0']):
2222
vector_type = "std::vector<int>"
2323
vector_of_vector_type = "std::vector<std::vector<int> >"
2424
else:

lldb/test/API/functionalities/data-formatter/data-formatter-stl/libcxx/shared_ptr/TestDataFormatterLibcxxSharedPtr.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ def test_shared_ptr_variables(self):
5858
self.assertRegex(valobj.summary, r"^10( strong=1)? weak=1$")
5959
self.assertNotEqual(valobj.child[0].unsigned, 0)
6060

61-
if self.expectedCompilerVersion(['>', '16.0']):
61+
if self.expectedCompiler(["clang"]) and self.expectedCompilerVersion(['>', '16.0']):
6262
string_type = "std::basic_string<char>"
6363
else:
6464
string_type = "std::basic_string<char, std::char_traits<char>, std::allocator<char> >"

lldb/test/API/functionalities/data-formatter/data-formatter-stl/libcxx/string/TestDataFormatterLibcxxString.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ def cleanup():
5252

5353
ns = self.namespace
5454

55-
if self.expectedCompilerVersion(['>', '16.0']):
55+
if self.expectedCompiler(["clang"]) and self.expectedCompilerVersion(['>', '16.0']):
5656
expected_basic_string = '%s::basic_string<unsigned char>'%ns
5757
else:
5858
expected_basic_string = '%s::basic_string<unsigned char, %s::char_traits<unsigned char>, ' \

lldb/test/API/functionalities/data-formatter/data-formatter-stl/libcxx/string_view/TestDataFormatterLibcxxStringView.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ def cleanup():
5656
# Execute the cleanup function during test case tear down.
5757
self.addTearDownHook(cleanup)
5858

59-
if self.expectedCompilerVersion(['>', '16.0']):
59+
if self.expectedCompiler(["clang"]) and self.expectedCompilerVersion(['>', '16.0']):
6060
expected_basic_string = 'std::basic_string<unsigned char>'
6161
expected_basic_string_view = 'std::basic_string_view<unsigned char>'
6262
else:

lldb/test/API/functionalities/data-formatter/data-formatter-stl/libcxx/unique_ptr/TestDataFormatterLibcxxUniquePtr.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,13 @@ def make_expected_type(self, pointee_type: str, qualifiers: str = "") -> str:
1515
if qualifiers:
1616
qualifiers = ' ' + qualifiers
1717

18-
if self.expectedCompilerVersion(['>', '16.0']):
18+
if self.expectedCompiler(["clang"]) and self.expectedCompilerVersion(['>', '16.0']):
1919
return f'std::unique_ptr<{pointee_type}>{qualifiers}'
2020
else:
2121
return f'std::unique_ptr<{pointee_type}, std::default_delete<{pointee_type}> >{qualifiers}'
2222

2323
def make_expected_basic_string_ptr(self) -> str:
24-
if self.expectedCompilerVersion(['>', '16.0']):
24+
if self.expectedCompiler(["clang"]) and self.expectedCompilerVersion(['>', '16.0']):
2525
return f'std::unique_ptr<std::basic_string<char> >'
2626
else:
2727
return 'std::unique_ptr<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, ' \

0 commit comments

Comments
 (0)