aboutsummaryrefslogtreecommitdiff
path: root/lldb/test/API/python_api
diff options
context:
space:
mode:
authorAndy Yankovsky <weratt@gmail.com>2020-12-22 10:06:46 -0800
committerJonas Devlieghere <jonas@devlieghere.com>2020-12-22 10:08:21 -0800
commite17a00fc87bc163cc2438ce10faca51d94b91ab3 (patch)
treed5221b884e753cbb003e9dfd34092f95a19910b2 /lldb/test/API/python_api
parentf5071489ea8cf2771d7375534c122467a000b356 (diff)
downloadllvm-e17a00fc87bc163cc2438ce10faca51d94b91ab3.zip
llvm-e17a00fc87bc163cc2438ce10faca51d94b91ab3.tar.gz
llvm-e17a00fc87bc163cc2438ce10faca51d94b91ab3.tar.bz2
[lldb] Add SBType::IsScopedEnumerationType method
Add a method to check if the type is a scoped enumeration (i.e. "enum class/struct"). Differential revision: https://reviews.llvm.org/D93690
Diffstat (limited to 'lldb/test/API/python_api')
-rw-r--r--lldb/test/API/python_api/type/TestTypeList.py10
-rw-r--r--lldb/test/API/python_api/type/main.cpp5
2 files changed, 15 insertions, 0 deletions
diff --git a/lldb/test/API/python_api/type/TestTypeList.py b/lldb/test/API/python_api/type/TestTypeList.py
index 901ddc6..6ed6ca4 100644
--- a/lldb/test/API/python_api/type/TestTypeList.py
+++ b/lldb/test/API/python_api/type/TestTypeList.py
@@ -144,3 +144,13 @@ class TypeAndTypeListTestCase(TestBase):
myint_type = target.FindFirstType('myint')
self.DebugSBType(myint_type)
self.assertTrue(myint_arr_element_type == myint_type)
+
+ # Test enum methods.
+ enum_type = target.FindFirstType('EnumType')
+ self.assertTrue(enum_type)
+ self.DebugSBType(enum_type)
+ self.assertFalse(enum_type.IsScopedEnumerationType())
+ scoped_enum_type = target.FindFirstType('ScopedEnumType')
+ self.assertTrue(scoped_enum_type)
+ self.DebugSBType(scoped_enum_type)
+ self.assertTrue(scoped_enum_type.IsScopedEnumerationType())
diff --git a/lldb/test/API/python_api/type/main.cpp b/lldb/test/API/python_api/type/main.cpp
index 13e6bbc..5b96f47 100644
--- a/lldb/test/API/python_api/type/main.cpp
+++ b/lldb/test/API/python_api/type/main.cpp
@@ -29,6 +29,8 @@ public:
{}
};
+enum EnumType {};
+enum class ScopedEnumType {};
int main (int argc, char const *argv[])
{
@@ -59,5 +61,8 @@ int main (int argc, char const *argv[])
typedef int myint;
myint myint_arr[] = {1, 2, 3};
+ EnumType enum_type;
+ ScopedEnumType scoped_enum_type;
+
return 0; // Break at this line
}