blob: 294aea77ed71eda40285c8e5a892fa9336db506d [file] [log] [blame]
Ted Kremenek8e0ac172010-05-14 21:29:26 +00001typedef int FooType;
2int *p;
3int *f(int *p, char *x, FooType z) {
Douglas Gregore72fb6f2011-01-27 16:27:11 +00004 const FooType w = z;
Ted Kremenek8e0ac172010-05-14 21:29:26 +00005 return p + z;
6}
Douglas Gregorfbcfeea2011-01-24 18:44:28 +00007typedef double OtherType;
Argyrios Kyrtzidis5f0bfc52011-09-27 17:44:34 +00008typedef int ArrayType[5];
Ted Kremenek8e0ac172010-05-14 21:29:26 +00009
10// RUN: c-index-test -test-print-typekind %s | FileCheck %s
Ted Kremenek3ce9e7d2010-07-30 00:14:11 +000011// CHECK: TypedefDecl=FooType:1:13 (Definition) typekind=Typedef [canonical=Int] [isPOD=1]
12// CHECK: VarDecl=p:2:6 typekind=Pointer [isPOD=1]
Argyrios Kyrtzidisd98ef9a2012-04-11 19:32:19 +000013// CHECK: FunctionDecl=f:3:6 (Definition) typekind=FunctionProto [canonical=FunctionProto] [result=Pointer] [args= Pointer Pointer Typedef] [isPOD=0]
Ted Kremenek3ce9e7d2010-07-30 00:14:11 +000014// CHECK: ParmDecl=p:3:13 (Definition) typekind=Pointer [isPOD=1]
15// CHECK: ParmDecl=x:3:22 (Definition) typekind=Pointer [isPOD=1]
16// CHECK: ParmDecl=z:3:33 (Definition) typekind=Typedef [canonical=Int] [isPOD=1]
Douglas Gregor3f0fee32010-10-02 21:57:58 +000017// CHECK: TypeRef=FooType:1:13 typekind=Typedef [canonical=Int] [isPOD=1]
Douglas Gregor42b29842011-10-05 19:00:14 +000018// CHECK: CompoundStmt= typekind=Invalid [isPOD=0]
19// CHECK: DeclStmt= typekind=Invalid [isPOD=0]
Douglas Gregore72fb6f2011-01-27 16:27:11 +000020// CHECK: VarDecl=w:4:17 (Definition) typekind=Typedef const [canonical=Int] [isPOD=1]
Douglas Gregor3f0fee32010-10-02 21:57:58 +000021// CHECK: TypeRef=FooType:1:13 typekind=Typedef [canonical=Int] [isPOD=1]
Ted Kremenek3ce9e7d2010-07-30 00:14:11 +000022// CHECK: DeclRefExpr=z:3:33 typekind=Typedef [canonical=Int] [isPOD=1]
Douglas Gregor42b29842011-10-05 19:00:14 +000023// CHECK: ReturnStmt= typekind=Invalid [isPOD=0]
24// CHECK: BinaryOperator= typekind=Pointer [isPOD=1]
Ted Kremenek3ce9e7d2010-07-30 00:14:11 +000025// CHECK: DeclRefExpr=p:3:13 typekind=Pointer [isPOD=1]
26// CHECK: DeclRefExpr=z:3:33 typekind=Typedef [canonical=Int] [isPOD=1]
Douglas Gregorfbcfeea2011-01-24 18:44:28 +000027// CHECK: TypedefDecl=OtherType:7:16 (Definition) typekind=Typedef [canonical=Double] [isPOD=1]
Argyrios Kyrtzidis5f0bfc52011-09-27 17:44:34 +000028// CHECK: TypedefDecl=ArrayType:8:13 (Definition) typekind=Typedef [canonical=ConstantArray] [isPOD=1]