summaryrefslogtreecommitdiffstats
path: root/lldb/packages/Python/lldbsuite/test/python_api
diff options
context:
space:
mode:
Diffstat (limited to 'lldb/packages/Python/lldbsuite/test/python_api')
-rw-r--r--lldb/packages/Python/lldbsuite/test/python_api/type/TestTypeList.py5
-rw-r--r--lldb/packages/Python/lldbsuite/test/python_api/type/main.cpp6
2 files changed, 11 insertions, 0 deletions
diff --git a/lldb/packages/Python/lldbsuite/test/python_api/type/TestTypeList.py b/lldb/packages/Python/lldbsuite/test/python_api/type/TestTypeList.py
index 58bf5e5b988..d9e5719844e 100644
--- a/lldb/packages/Python/lldbsuite/test/python_api/type/TestTypeList.py
+++ b/lldb/packages/Python/lldbsuite/test/python_api/type/TestTypeList.py
@@ -59,11 +59,16 @@ class TypeAndTypeListTestCase(TestBase):
for type in type_list:
self.assertTrue(type)
self.DebugSBType(type)
+ self.assertFalse(type.IsAnonymousType(), "Task is not anonymous")
for field in type.fields:
if field.name == "type":
for enum_member in field.type.enum_members:
self.assertTrue(enum_member)
self.DebugSBType(enum_member.type)
+ elif field.name == "my_type_is_nameless":
+ self.assertTrue(field.type.IsAnonymousType(), "my_type_is_nameless has an anonymous type")
+ elif field.name == "my_type_is_named":
+ self.assertFalse(field.type.IsAnonymousType(), "my_type_is_named has a named type")
# Pass an empty string. LLDB should not crash. :-)
fuzz_types = target.FindTypes(None)
diff --git a/lldb/packages/Python/lldbsuite/test/python_api/type/main.cpp b/lldb/packages/Python/lldbsuite/test/python_api/type/main.cpp
index 67b57ace08f..b7f3dcc7fbe 100644
--- a/lldb/packages/Python/lldbsuite/test/python_api/type/main.cpp
+++ b/lldb/packages/Python/lldbsuite/test/python_api/type/main.cpp
@@ -16,6 +16,12 @@ public:
TASK_TYPE_1,
TASK_TYPE_2
} type;
+ struct {
+ int x;
+ } my_type_is_nameless;
+ struct name {
+ int x;
+ } my_type_is_named;
Task(int i, Task *n):
id(i),
next(n),
OpenPOWER on IntegriCloud