[lldb][import-std-module] Add a test for typedef'd std types
authorRaphael Isemann <teemperor@gmail.com>
Tue, 8 Dec 2020 12:33:14 +0000 (13:33 +0100)
committerRaphael Isemann <teemperor@gmail.com>
Tue, 8 Dec 2020 12:36:13 +0000 (13:36 +0100)
lldb/test/API/commands/expression/import-std-module/vector/TestVectorFromStdModule.py
lldb/test/API/commands/expression/import-std-module/vector/main.cpp

index 9a186e7..a03c347 100644 (file)
@@ -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"),
+                         ])
index edf130d..668b591 100644 (file)
@@ -1,6 +1,8 @@
 #include <vector>
 
+typedef std::vector<long> vector_long;
 int main(int argc, char **argv) {
   std::vector<int> a = {3, 1, 2};
+  vector_long b = {3, 1, 2};
   return 0; // Set break point at this line.
 }