Commit 9eb29f15 authored by Bill Wendling's avatar Bill Wendling
Browse files

Merging r142476:

------------------------------------------------------------------------
r142476 | dgregor | 2011-10-18 22:50:34 -0700 (Tue, 18 Oct 2011) | 2 lines

Add TypeKind.CONSTANTARRAY, from  Anders Waldenborg!

------------------------------------------------------------------------

llvm-svn: 142723
parent 20529b79
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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):
    """
+19 −0
Original line number Diff line number Diff line
@@ -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??"