From 6face9119c811e06cfb284755953ba6cdbdaa22b Mon Sep 17 00:00:00 2001 From: Raphael Isemann Date: Tue, 8 Dec 2020 13:33:14 +0100 Subject: [PATCH] [lldb][import-std-module] Add a test for typedef'd std types --- .../vector/TestVectorFromStdModule.py | 10 ++++++++++ .../expression/import-std-module/vector/main.cpp | 2 ++ 2 files changed, 12 insertions(+) diff --git a/lldb/test/API/commands/expression/import-std-module/vector/TestVectorFromStdModule.py b/lldb/test/API/commands/expression/import-std-module/vector/TestVectorFromStdModule.py index 9a186e7a2243..a03c347a728f 100644 --- a/lldb/test/API/commands/expression/import-std-module/vector/TestVectorFromStdModule.py +++ b/lldb/test/API/commands/expression/import-std-module/vector/TestVectorFromStdModule.py @@ -87,3 +87,13 @@ class TestBasicVector(TestBase): ValueCheck(value="4"), ValueCheck(value="5") ]) + + # Test that the typedef'd vector type can be substituted. + self.expect("expr b.emplace_back(6)") + self.expect_expr("b", result_type="vector_long", + result_children=[ + ValueCheck(value="3"), + ValueCheck(value="1"), + ValueCheck(value="2"), + ValueCheck(value="6"), + ]) diff --git a/lldb/test/API/commands/expression/import-std-module/vector/main.cpp b/lldb/test/API/commands/expression/import-std-module/vector/main.cpp index edf130d47488..668b59181d42 100644 --- a/lldb/test/API/commands/expression/import-std-module/vector/main.cpp +++ b/lldb/test/API/commands/expression/import-std-module/vector/main.cpp @@ -1,6 +1,8 @@ #include +typedef std::vector vector_long; int main(int argc, char **argv) { std::vector a = {3, 1, 2}; + vector_long b = {3, 1, 2}; return 0; // Set break point at this line. }