aboutsummaryrefslogtreecommitdiff
path: root/lldb/test/API/python_api
diff options
context:
space:
mode:
authorAndy Yankovsky <weratt@gmail.com>2020-11-03 10:32:42 -0800
committerJonas Devlieghere <jonas@devlieghere.com>2020-11-03 10:53:44 -0800
commitf35a82384d9ebeff3bb5ffd7a5ebe30436c1b401 (patch)
treee7622fed561badf9ab3cae9cb713951195ad9a23 /lldb/test/API/python_api
parent107c3a12d627f12a23f138a00d6aabe9de7402f7 (diff)
downloadllvm-f35a82384d9ebeff3bb5ffd7a5ebe30436c1b401.zip
llvm-f35a82384d9ebeff3bb5ffd7a5ebe30436c1b401.tar.gz
llvm-f35a82384d9ebeff3bb5ffd7a5ebe30436c1b401.tar.bz2
Return actual type from SBType::GetArrayElementType
SBType::GetArrayElementType should return the actual type, not the canonical type (e.g. int32_t, not the underlying int). Added a test case to validate the new behavior. I also ran all other tests on Linux (ninja check-lldb), they all pass. Differential revision: https://reviews.llvm.org/D90318
Diffstat (limited to 'lldb/test/API/python_api')
-rw-r--r--lldb/test/API/python_api/type/TestTypeList.py13
-rw-r--r--lldb/test/API/python_api/type/main.cpp3
2 files changed, 16 insertions, 0 deletions
diff --git a/lldb/test/API/python_api/type/TestTypeList.py b/lldb/test/API/python_api/type/TestTypeList.py
index 75a793a..901ddc6 100644
--- a/lldb/test/API/python_api/type/TestTypeList.py
+++ b/lldb/test/API/python_api/type/TestTypeList.py
@@ -131,3 +131,16 @@ class TypeAndTypeListTestCase(TestBase):
# (lldb-enumerations.h).
int_type = id_type.GetBasicType(lldb.eBasicTypeInt)
self.assertTrue(id_type == int_type)
+
+ # Find 'myint_arr' and check the array element type.
+ myint_arr = frame0.FindVariable('myint_arr')
+ self.assertTrue(myint_arr, VALID_VARIABLE)
+ self.DebugSBValue(myint_arr)
+ myint_arr_type = myint_arr.GetType()
+ self.DebugSBType(myint_arr_type)
+ self.assertTrue(myint_arr_type.IsArrayType())
+ myint_arr_element_type = myint_arr_type.GetArrayElementType()
+ self.DebugSBType(myint_arr_element_type)
+ myint_type = target.FindFirstType('myint')
+ self.DebugSBType(myint_type)
+ self.assertTrue(myint_arr_element_type == myint_type)
diff --git a/lldb/test/API/python_api/type/main.cpp b/lldb/test/API/python_api/type/main.cpp
index 40799ab..13e6bbc 100644
--- a/lldb/test/API/python_api/type/main.cpp
+++ b/lldb/test/API/python_api/type/main.cpp
@@ -56,5 +56,8 @@ int main (int argc, char const *argv[])
// This corresponds to an empty task list.
Task *empty_task_head = new Task(-1, NULL);
+ typedef int myint;
+ myint myint_arr[] = {1, 2, 3};
+
return 0; // Break at this line
}