blob: fad3a2dc252384a3a3d02031baa114d89e3e1389 [file] [log] [blame]
Ted Kremenek8e0ac172010-05-14 21:29:26 +00001typedef int FooType;
2int *p;
3int *f(int *p, char *x, FooType z) {
4 FooType w = z;
5 return p + z;
6}
Douglas Gregorfbcfeea2011-01-24 18:44:28 +00007typedef double OtherType;
Ted Kremenek8e0ac172010-05-14 21:29:26 +00008
9// RUN: c-index-test -test-print-typekind %s | FileCheck %s
Ted Kremenek3ce9e7d2010-07-30 00:14:11 +000010// CHECK: TypedefDecl=FooType:1:13 (Definition) typekind=Typedef [canonical=Int] [isPOD=1]
11// CHECK: VarDecl=p:2:6 typekind=Pointer [isPOD=1]
12// CHECK: FunctionDecl=f:3:6 (Definition) typekind=FunctionProto [canonical=FunctionProto] [result=Pointer] [isPOD=0]
13// CHECK: ParmDecl=p:3:13 (Definition) typekind=Pointer [isPOD=1]
14// CHECK: ParmDecl=x:3:22 (Definition) typekind=Pointer [isPOD=1]
15// CHECK: ParmDecl=z:3:33 (Definition) typekind=Typedef [canonical=Int] [isPOD=1]
Douglas Gregor3f0fee32010-10-02 21:57:58 +000016// CHECK: TypeRef=FooType:1:13 typekind=Typedef [canonical=Int] [isPOD=1]
Ted Kremenek3ce9e7d2010-07-30 00:14:11 +000017// CHECK: UnexposedStmt= typekind=Invalid [isPOD=0]
18// CHECK: UnexposedStmt= typekind=Invalid [isPOD=0]
19// CHECK: VarDecl=w:4:11 (Definition) typekind=Typedef [canonical=Int] [isPOD=1]
Douglas Gregor3f0fee32010-10-02 21:57:58 +000020// CHECK: TypeRef=FooType:1:13 typekind=Typedef [canonical=Int] [isPOD=1]
Ted Kremenek3ce9e7d2010-07-30 00:14:11 +000021// CHECK: DeclRefExpr=z:3:33 typekind=Typedef [canonical=Int] [isPOD=1]
22// CHECK: UnexposedStmt= typekind=Invalid [isPOD=0]
23// CHECK: UnexposedExpr= typekind=Pointer [isPOD=1]
24// CHECK: DeclRefExpr=p:3:13 typekind=Pointer [isPOD=1]
25// CHECK: DeclRefExpr=z:3:33 typekind=Typedef [canonical=Int] [isPOD=1]
Douglas Gregorfbcfeea2011-01-24 18:44:28 +000026// CHECK: TypedefDecl=OtherType:7:16 (Definition) typekind=Typedef [canonical=Double] [isPOD=1]
Ted Kremenek8e0ac172010-05-14 21:29:26 +000027