Ted Kremenek | 8e0ac17 | 2010-05-14 21:29:26 +0000 | [diff] [blame] | 1 | typedef int FooType; |
| 2 | int *p; |
| 3 | int *f(int *p, char *x, FooType z) { |
Douglas Gregor | e72fb6f | 2011-01-27 16:27:11 +0000 | [diff] [blame] | 4 | const FooType w = z; |
Ted Kremenek | 8e0ac17 | 2010-05-14 21:29:26 +0000 | [diff] [blame] | 5 | return p + z; |
| 6 | } |
Douglas Gregor | fbcfeea | 2011-01-24 18:44:28 +0000 | [diff] [blame] | 7 | typedef double OtherType; |
Argyrios Kyrtzidis | 5f0bfc5 | 2011-09-27 17:44:34 +0000 | [diff] [blame] | 8 | typedef int ArrayType[5]; |
Ted Kremenek | 8e0ac17 | 2010-05-14 21:29:26 +0000 | [diff] [blame] | 9 | |
| 10 | // RUN: c-index-test -test-print-typekind %s | FileCheck %s |
Ted Kremenek | 3ce9e7d | 2010-07-30 00:14:11 +0000 | [diff] [blame] | 11 | // CHECK: TypedefDecl=FooType:1:13 (Definition) typekind=Typedef [canonical=Int] [isPOD=1] |
| 12 | // CHECK: VarDecl=p:2:6 typekind=Pointer [isPOD=1] |
Argyrios Kyrtzidis | d98ef9a | 2012-04-11 19:32:19 +0000 | [diff] [blame] | 13 | // CHECK: FunctionDecl=f:3:6 (Definition) typekind=FunctionProto [canonical=FunctionProto] [result=Pointer] [args= Pointer Pointer Typedef] [isPOD=0] |
Ted Kremenek | 3ce9e7d | 2010-07-30 00:14:11 +0000 | [diff] [blame] | 14 | // 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 Gregor | 3f0fee3 | 2010-10-02 21:57:58 +0000 | [diff] [blame] | 17 | // CHECK: TypeRef=FooType:1:13 typekind=Typedef [canonical=Int] [isPOD=1] |
Douglas Gregor | 42b2984 | 2011-10-05 19:00:14 +0000 | [diff] [blame] | 18 | // CHECK: CompoundStmt= typekind=Invalid [isPOD=0] |
| 19 | // CHECK: DeclStmt= typekind=Invalid [isPOD=0] |
Douglas Gregor | e72fb6f | 2011-01-27 16:27:11 +0000 | [diff] [blame] | 20 | // CHECK: VarDecl=w:4:17 (Definition) typekind=Typedef const [canonical=Int] [isPOD=1] |
Douglas Gregor | 3f0fee3 | 2010-10-02 21:57:58 +0000 | [diff] [blame] | 21 | // CHECK: TypeRef=FooType:1:13 typekind=Typedef [canonical=Int] [isPOD=1] |
Ted Kremenek | 3ce9e7d | 2010-07-30 00:14:11 +0000 | [diff] [blame] | 22 | // CHECK: DeclRefExpr=z:3:33 typekind=Typedef [canonical=Int] [isPOD=1] |
Douglas Gregor | 42b2984 | 2011-10-05 19:00:14 +0000 | [diff] [blame] | 23 | // CHECK: ReturnStmt= typekind=Invalid [isPOD=0] |
| 24 | // CHECK: BinaryOperator= typekind=Pointer [isPOD=1] |
Ted Kremenek | 3ce9e7d | 2010-07-30 00:14:11 +0000 | [diff] [blame] | 25 | // CHECK: DeclRefExpr=p:3:13 typekind=Pointer [isPOD=1] |
| 26 | // CHECK: DeclRefExpr=z:3:33 typekind=Typedef [canonical=Int] [isPOD=1] |
Douglas Gregor | fbcfeea | 2011-01-24 18:44:28 +0000 | [diff] [blame] | 27 | // CHECK: TypedefDecl=OtherType:7:16 (Definition) typekind=Typedef [canonical=Double] [isPOD=1] |
Argyrios Kyrtzidis | 5f0bfc5 | 2011-09-27 17:44:34 +0000 | [diff] [blame] | 28 | // CHECK: TypedefDecl=ArrayType:8:13 (Definition) typekind=Typedef [canonical=ConstantArray] [isPOD=1] |