summaryrefslogtreecommitdiffstats
path: root/bindings/python/tests
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2011-10-19 05:50:34 +0000
committerDouglas Gregor <dgregor@apple.com>2011-10-19 05:50:34 +0000
commit38d2d5539e72ce3d92c4746b632f3a7c2e48b4a2 (patch)
tree87b6f4836b35f08582e1de59cebb8fec7fdad5c1 /bindings/python/tests
parent9d342ab031ba831263291a3bcda485e684508ea9 (diff)
Add TypeKind.CONSTANTARRAY, from Anders Waldenborg!
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@142476 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'bindings/python/tests')
-rw-r--r--bindings/python/tests/cindex/test_type.py19
1 files changed, 19 insertions, 0 deletions
diff --git a/bindings/python/tests/cindex/test_type.py b/bindings/python/tests/cindex/test_type.py
index cd27a4cbb9..35c7bbbfa2 100644
--- a/bindings/python/tests/cindex/test_type.py
+++ b/bindings/python/tests/cindex/test_type.py
@@ -74,3 +74,22 @@ def test_a_struct():
else:
assert False, "Didn't find teststruct??"
+
+
+constarrayInput="""
+struct teststruct {
+ void *A[2];
+};
+"""
+def testConstantArray():
+ index = Index.create()
+ tu = index.parse('t.c', unsaved_files = [('t.c',constarrayInput)])
+
+ for n in tu.cursor.get_children():
+ if n.spelling == 'teststruct':
+ fields = list(n.get_children())
+ assert fields[0].spelling == 'A'
+ assert fields[0].type.kind == TypeKind.CONSTANTARRAY
+ break
+ else:
+ assert False, "Didn't find teststruct??"