Add TypeKind.CONSTANTARRAY, from Anders Waldenborg!

llvm-svn: 142476
This commit is contained in:
Douglas Gregor 2011-10-19 05:50:34 +00:00
parent d59d02cc38
commit 89861066ed
2 changed files with 20 additions and 1 deletions

View File

@ -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):
"""

View File

@ -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??"