diff options
author | Douglas Gregor <dgregor@apple.com> | 2011-10-19 05:50:34 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2011-10-19 05:50:34 +0000 |
commit | 38d2d5539e72ce3d92c4746b632f3a7c2e48b4a2 (patch) | |
tree | 87b6f4836b35f08582e1de59cebb8fec7fdad5c1 /bindings | |
parent | 9d342ab031ba831263291a3bcda485e684508ea9 (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')
-rw-r--r-- | bindings/python/clang/cindex.py | 2 | ||||
-rw-r--r-- | bindings/python/tests/cindex/test_type.py | 19 |
2 files changed, 20 insertions, 1 deletions
diff --git a/bindings/python/clang/cindex.py b/bindings/python/clang/cindex.py index ee8c5e8384..8f1a8b8cce 100644 --- a/bindings/python/clang/cindex.py +++ b/bindings/python/clang/cindex.py @@ -1019,7 +1019,7 @@ TypeKind.OBJCINTERFACE = TypeKind(108) TypeKind.OBJCOBJECTPOINTER = TypeKind(109) TypeKind.FUNCTIONNOPROTO = TypeKind(110) TypeKind.FUNCTIONPROTO = TypeKind(111) - +TypeKind.CONSTANTARRAY = TypeKind(112) class Type(Structure): """ 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??" |