1ae03d8e52d81adbb98b31dd5c179abe45c91fc25Dmitri Gribenkotypedef int FooType;
2ae03d8e52d81adbb98b31dd5c179abe45c91fc25Dmitri Gribenkoint *p;
3ae03d8e52d81adbb98b31dd5c179abe45c91fc25Dmitri Gribenkoint *f(int *p, char *x, FooType z, int arr[5], void (*fn)(int)) {
4ae03d8e52d81adbb98b31dd5c179abe45c91fc25Dmitri Gribenko  fn(*p);
5ae03d8e52d81adbb98b31dd5c179abe45c91fc25Dmitri Gribenko  const FooType w = z;
6ae03d8e52d81adbb98b31dd5c179abe45c91fc25Dmitri Gribenko  return p + z + arr[3];
7ae03d8e52d81adbb98b31dd5c179abe45c91fc25Dmitri Gribenko}
8ae03d8e52d81adbb98b31dd5c179abe45c91fc25Dmitri Gribenkotypedef double OtherType;
9ae03d8e52d81adbb98b31dd5c179abe45c91fc25Dmitri Gribenkotypedef int ArrayType[5];
10ae03d8e52d81adbb98b31dd5c179abe45c91fc25Dmitri Gribenkoint __attribute__((vector_size(16))) x;
11ae03d8e52d81adbb98b31dd5c179abe45c91fc25Dmitri Gribenkotypedef int __attribute__((vector_size(16))) int4_t;
12ae03d8e52d81adbb98b31dd5c179abe45c91fc25Dmitri Gribenko
13ae03d8e52d81adbb98b31dd5c179abe45c91fc25Dmitri Gribenko// RUN: c-index-test -test-print-type %s | FileCheck %s
14c910d4cfa5042f2c9da1eb4e0b6ed59240c0eeeeReid Kleckner// CHECK: FunctionDecl=f:3:6 (Definition) [type=int *(int *, char *, FooType, int *, void (*)(int))] [typekind=FunctionProto] [canonicaltype=int *(int *, char *, int, int *, void (*)(int))] [canonicaltypekind=FunctionProto] [resulttype=int *] [resulttypekind=Pointer] [args= [int *] [Pointer] [char *] [Pointer] [FooType] [Typedef] [int [5]] [ConstantArray] [void (*)(int)] [Pointer]] [isPOD=0]
15ae03d8e52d81adbb98b31dd5c179abe45c91fc25Dmitri Gribenko// CHECK: ParmDecl=p:3:13 (Definition) [type=int *] [typekind=Pointer] [isPOD=1]
16ae03d8e52d81adbb98b31dd5c179abe45c91fc25Dmitri Gribenko// CHECK: ParmDecl=x:3:22 (Definition) [type=char *] [typekind=Pointer] [isPOD=1]
17ae03d8e52d81adbb98b31dd5c179abe45c91fc25Dmitri Gribenko// CHECK: ParmDecl=z:3:33 (Definition) [type=FooType] [typekind=Typedef] [canonicaltype=int] [canonicaltypekind=Int] [isPOD=1]
18ae03d8e52d81adbb98b31dd5c179abe45c91fc25Dmitri Gribenko// CHECK: TypeRef=FooType:1:13 [type=FooType] [typekind=Typedef] [canonicaltype=int] [canonicaltypekind=Int] [isPOD=1]
197717914639ed8a186fe8b781c9c220594e8dcf30Argyrios Kyrtzidis// CHECK: ParmDecl=arr:3:40 (Definition) [type=int [5]] [typekind=ConstantArray] [isPOD=1]
20ae03d8e52d81adbb98b31dd5c179abe45c91fc25Dmitri Gribenko// CHECK: IntegerLiteral= [type=int] [typekind=Int] [isPOD=1]
21ae03d8e52d81adbb98b31dd5c179abe45c91fc25Dmitri Gribenko// CHECK: ParmDecl=fn:3:55 (Definition) [type=void (*)(int)] [typekind=Pointer] [canonicaltype=void (*)(int)] [canonicaltypekind=Pointer] [isPOD=1]
22ae03d8e52d81adbb98b31dd5c179abe45c91fc25Dmitri Gribenko// CHECK: ParmDecl=:3:62 (Definition) [type=int] [typekind=Int] [isPOD=1]
23ae03d8e52d81adbb98b31dd5c179abe45c91fc25Dmitri Gribenko// CHECK: CompoundStmt= [type=] [typekind=Invalid] [isPOD=0]
24e9ebd852ec1effa393bcc4aad73d9c657a5279c1Argyrios Kyrtzidis// CHECK: CallExpr=fn:3:55 [type=void] [typekind=Void] [args= [int] [Int]] [isPOD=0]
25ae03d8e52d81adbb98b31dd5c179abe45c91fc25Dmitri Gribenko// CHECK: DeclRefExpr=fn:3:55 [type=void (*)(int)] [typekind=Pointer] [canonicaltype=void (*)(int)] [canonicaltypekind=Pointer] [isPOD=1]
26ae03d8e52d81adbb98b31dd5c179abe45c91fc25Dmitri Gribenko// CHECK: UnaryOperator= [type=int] [typekind=Int] [isPOD=1]
27ae03d8e52d81adbb98b31dd5c179abe45c91fc25Dmitri Gribenko// CHECK: DeclRefExpr=p:3:13 [type=int *] [typekind=Pointer] [isPOD=1]
28ae03d8e52d81adbb98b31dd5c179abe45c91fc25Dmitri Gribenko// CHECK: DeclStmt= [type=] [typekind=Invalid] [isPOD=0]
29ae03d8e52d81adbb98b31dd5c179abe45c91fc25Dmitri Gribenko// CHECK: VarDecl=w:5:17 (Definition) [type=const FooType] [typekind=Typedef] const [canonicaltype=const int] [canonicaltypekind=Int] [isPOD=1]
30ae03d8e52d81adbb98b31dd5c179abe45c91fc25Dmitri Gribenko// CHECK: TypeRef=FooType:1:13 [type=FooType] [typekind=Typedef] [canonicaltype=int] [canonicaltypekind=Int] [isPOD=1]
31ae03d8e52d81adbb98b31dd5c179abe45c91fc25Dmitri Gribenko// CHECK: DeclRefExpr=z:3:33 [type=FooType] [typekind=Typedef] [canonicaltype=int] [canonicaltypekind=Int] [isPOD=1]
32ae03d8e52d81adbb98b31dd5c179abe45c91fc25Dmitri Gribenko// CHECK: ReturnStmt= [type=] [typekind=Invalid] [isPOD=0]
33ae03d8e52d81adbb98b31dd5c179abe45c91fc25Dmitri Gribenko// CHECK: BinaryOperator= [type=int *] [typekind=Pointer] [isPOD=1]
34ae03d8e52d81adbb98b31dd5c179abe45c91fc25Dmitri Gribenko// CHECK: BinaryOperator= [type=int *] [typekind=Pointer] [isPOD=1]
35ae03d8e52d81adbb98b31dd5c179abe45c91fc25Dmitri Gribenko// CHECK: DeclRefExpr=p:3:13 [type=int *] [typekind=Pointer] [isPOD=1]
36ae03d8e52d81adbb98b31dd5c179abe45c91fc25Dmitri Gribenko// CHECK: DeclRefExpr=z:3:33 [type=FooType] [typekind=Typedef] [canonicaltype=int] [canonicaltypekind=Int] [isPOD=1]
37ae03d8e52d81adbb98b31dd5c179abe45c91fc25Dmitri Gribenko// CHECK: ArraySubscriptExpr= [type=int] [typekind=Int] [isPOD=1]
3812df246d6dea2ee1f92c186f922f1afcf499647aReid Kleckner// CHECK: UnexposedExpr=arr:3:40 [type=int *] [typekind=Unexposed] [canonicaltype=int *] [canonicaltypekind=Pointer] [isPOD=1]
39ae03d8e52d81adbb98b31dd5c179abe45c91fc25Dmitri Gribenko// CHECK: IntegerLiteral= [type=int] [typekind=Int] [isPOD=1]
40ae03d8e52d81adbb98b31dd5c179abe45c91fc25Dmitri Gribenko// CHECK: TypedefDecl=OtherType:8:16 (Definition) [type=OtherType] [typekind=Typedef] [canonicaltype=double] [canonicaltypekind=Double] [isPOD=1]
41ae03d8e52d81adbb98b31dd5c179abe45c91fc25Dmitri Gribenko// CHECK: TypedefDecl=ArrayType:9:13 (Definition) [type=ArrayType] [typekind=Typedef] [canonicaltype=int [5]] [canonicaltypekind=ConstantArray] [isPOD=1]
42ae03d8e52d81adbb98b31dd5c179abe45c91fc25Dmitri Gribenko// CHECK: IntegerLiteral= [type=int] [typekind=Int] [isPOD=1]
43ae03d8e52d81adbb98b31dd5c179abe45c91fc25Dmitri Gribenko// CHECK: VarDecl=x:10:38 [type=__attribute__((__vector_size__(4 * sizeof(int)))) int] [typekind=Vector] [isPOD=1]
44ae03d8e52d81adbb98b31dd5c179abe45c91fc25Dmitri Gribenko// CHECK: TypedefDecl=int4_t:11:46 (Definition) [type=int4_t] [typekind=Typedef] [canonicaltype=__attribute__((__vector_size__(4 * sizeof(int)))) int] [canonicaltypekind=Vector] [isPOD=1]
45