summaryrefslogtreecommitdiffstats
path: root/bindings
diff options
context:
space:
mode:
authorArgyrios Kyrtzidis <akyrtzi@gmail.com>2013-07-23 17:36:21 +0000
committerArgyrios Kyrtzidis <akyrtzi@gmail.com>2013-07-23 17:36:21 +0000
commit4c4f6fe2a6d6b3ffd0ce114cb8099366662b67f7 (patch)
tree4a1b455eb8fe68c635b9c90b4c13a17246c127f3 /bindings
parentd732928074294839feebc3b8f00fbf5922d271ba (diff)
[libclang] Expose the rest of the array types.
Patch by Che-Liang Chiou! git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@186967 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'bindings')
-rw-r--r--bindings/python/clang/cindex.py3
-rw-r--r--bindings/python/tests/cindex/test_type.py12
2 files changed, 13 insertions, 2 deletions
diff --git a/bindings/python/clang/cindex.py b/bindings/python/clang/cindex.py
index 8316b1ff9f..7fe5f7ddab 100644
--- a/bindings/python/clang/cindex.py
+++ b/bindings/python/clang/cindex.py
@@ -1483,6 +1483,9 @@ TypeKind.FUNCTIONNOPROTO = TypeKind(110)
TypeKind.FUNCTIONPROTO = TypeKind(111)
TypeKind.CONSTANTARRAY = TypeKind(112)
TypeKind.VECTOR = TypeKind(113)
+TypeKind.INCOMPLETEARRAY = TypeKind(114)
+TypeKind.VARIABLEARRAY = TypeKind(115)
+TypeKind.DEPENDENTSIZEDARRAY = TypeKind(116)
class Type(Structure):
"""
diff --git a/bindings/python/tests/cindex/test_type.py b/bindings/python/tests/cindex/test_type.py
index 9bbed5aa94..ed3d65c378 100644
--- a/bindings/python/tests/cindex/test_type.py
+++ b/bindings/python/tests/cindex/test_type.py
@@ -237,12 +237,20 @@ void bar(int a, int b);
def test_element_type():
"""Ensure Type.element_type works."""
- tu = get_tu('int i[5];')
+ tu = get_tu('int c[5]; int i[]; int x; int v[x];')
+ c = get_cursor(tu, 'c')
i = get_cursor(tu, 'i')
+ v = get_cursor(tu, 'v')
+ assert c is not None
assert i is not None
+ assert v is not None
- assert i.type.kind == TypeKind.CONSTANTARRAY
+ assert c.type.kind == TypeKind.CONSTANTARRAY
+ assert c.type.element_type.kind == TypeKind.INT
+ assert i.type.kind == TypeKind.INCOMPLETEARRAY
assert i.type.element_type.kind == TypeKind.INT
+ assert v.type.kind == TypeKind.VARIABLEARRAY
+ assert v.type.element_type.kind == TypeKind.INT
@raises(Exception)
def test_invalid_element_type():