diff options
author | rdivacky <rdivacky@FreeBSD.org> | 2010-05-27 15:17:06 +0000 |
---|---|---|
committer | rdivacky <rdivacky@FreeBSD.org> | 2010-05-27 15:17:06 +0000 |
commit | 53992adde3eda3ccf9da63bc7e45673f043de18f (patch) | |
tree | 3558f327a6f9ab59c5d7a06528d84e1560445247 /test/Index | |
parent | 7e411337c0ed226dace6e07f1420486768161308 (diff) | |
download | FreeBSD-src-53992adde3eda3ccf9da63bc7e45673f043de18f.zip FreeBSD-src-53992adde3eda3ccf9da63bc7e45673f043de18f.tar.gz |
Update clang to r104832.
Diffstat (limited to 'test/Index')
-rw-r--r-- | test/Index/annotate-tokens-include.c | 6 | ||||
-rw-r--r-- | test/Index/annotate-tokens-include.h | 1 | ||||
-rw-r--r-- | test/Index/annotate-tokens.c | 78 | ||||
-rw-r--r-- | test/Index/annotate-tokens.m | 272 | ||||
-rw-r--r-- | test/Index/c-index-api-loadTU-test.m | 38 | ||||
-rw-r--r-- | test/Index/complete-at-directives.m | 14 | ||||
-rw-r--r-- | test/Index/complete-at-exprstmt.m | 6 | ||||
-rw-r--r-- | test/Index/complete-exprs.c | 15 | ||||
-rw-r--r-- | test/Index/complete-member-access.m | 4 | ||||
-rw-r--r-- | test/Index/complete-recovery.m | 21 | ||||
-rw-r--r-- | test/Index/load-stmts.cpp | 30 | ||||
-rw-r--r-- | test/Index/print-typekind.c | 20 | ||||
-rw-r--r-- | test/Index/properties-class-extensions.m | 28 | ||||
-rw-r--r-- | test/Index/remap-load.c | 4 | ||||
-rw-r--r-- | test/Index/usrs.cpp | 107 | ||||
-rw-r--r-- | test/Index/usrs.m | 28 |
16 files changed, 542 insertions, 130 deletions
diff --git a/test/Index/annotate-tokens-include.c b/test/Index/annotate-tokens-include.c new file mode 100644 index 0000000..3c3c43b --- /dev/null +++ b/test/Index/annotate-tokens-include.c @@ -0,0 +1,6 @@ +#include "annotate-tokens-include.h" + +// RUN: c-index-test -test-annotate-tokens=%s:1:1:2:1 %s | FileCheck %s +// CHECK: Identifier: "include" [1:2 - 1:9] preprocessing directive= +// CHECK: Literal: ""annotate-tokens-include.h"" [1:10 - 1:37] preprocessing directive= + diff --git a/test/Index/annotate-tokens-include.h b/test/Index/annotate-tokens-include.h new file mode 100644 index 0000000..5d5f8f0 --- /dev/null +++ b/test/Index/annotate-tokens-include.h @@ -0,0 +1 @@ +int foo(); diff --git a/test/Index/annotate-tokens.c b/test/Index/annotate-tokens.c index 7fbf9cc..41f182d 100644 --- a/test/Index/annotate-tokens.c +++ b/test/Index/annotate-tokens.c @@ -11,55 +11,55 @@ void f(void *ptr) { // RUN: c-index-test -test-annotate-tokens=%s:4:1:9:32 %s | FileCheck %s // CHECK: Identifier: "T" [4:3 - 4:4] TypeRef=T:1:13 -// CHECK: Punctuation: "*" [4:4 - 4:5] +// CHECK: Punctuation: "*" [4:4 - 4:5] VarDecl=t_ptr:4:6 (Definition) // CHECK: Identifier: "t_ptr" [4:6 - 4:11] VarDecl=t_ptr:4:6 (Definition) -// CHECK: Punctuation: "=" [4:12 - 4:13] -// CHECK: Punctuation: "(" [4:14 - 4:15] +// CHECK: Punctuation: "=" [4:12 - 4:13] VarDecl=t_ptr:4:6 (Definition) +// CHECK: Punctuation: "(" [4:14 - 4:15] UnexposedExpr=ptr:3:14 // CHECK: Identifier: "T" [4:15 - 4:16] TypeRef=T:1:13 -// CHECK: Punctuation: "*" [4:17 - 4:18] -// CHECK: Punctuation: ")" [4:18 - 4:19] +// CHECK: Punctuation: "*" [4:17 - 4:18] UnexposedExpr=ptr:3:14 +// CHECK: Punctuation: ")" [4:18 - 4:19] UnexposedExpr=ptr:3:14 // CHECK: Identifier: "ptr" [4:19 - 4:22] DeclRefExpr=ptr:3:14 -// CHECK: Punctuation: ";" [4:22 - 4:23] -// CHECK: Punctuation: "(" [5:3 - 5:4] -// CHECK: Keyword: "void" [5:4 - 5:8] -// CHECK: Punctuation: ")" [5:8 - 5:9] -// CHECK: Keyword: "sizeof" [5:9 - 5:15] -// CHECK: Punctuation: "(" [5:15 - 5:16] +// CHECK: Punctuation: ";" [4:22 - 4:23] UnexposedStmt= +// CHECK: Punctuation: "(" [5:3 - 5:4] UnexposedExpr= +// CHECK: Keyword: "void" [5:4 - 5:8] UnexposedExpr= +// CHECK: Punctuation: ")" [5:8 - 5:9] UnexposedExpr= +// CHECK: Keyword: "sizeof" [5:9 - 5:15] UnexposedExpr= +// CHECK: Punctuation: "(" [5:15 - 5:16] UnexposedExpr= // CHECK: Identifier: "T" [5:16 - 5:17] TypeRef=T:1:13 -// CHECK: Punctuation: ")" [5:17 - 5:18] -// CHECK: Punctuation: ";" [5:18 - 5:19] -// CHECK: Comment: "/* A comment */" [6:3 - 6:18] -// CHECK: Keyword: "struct" [7:3 - 7:9] +// CHECK: Punctuation: ")" [5:17 - 5:18] UnexposedExpr= +// CHECK: Punctuation: ";" [5:18 - 5:19] UnexposedStmt= +// CHECK: Comment: "/* A comment */" [6:3 - 6:18] UnexposedStmt= +// CHECK: Keyword: "struct" [7:3 - 7:9] UnexposedStmt= // CHECK: Identifier: "X" [7:10 - 7:11] TypeRef=struct X:2:8 // CHECK: Identifier: "x" [7:12 - 7:13] VarDecl=x:7:12 (Definition) -// CHECK: Punctuation: "=" [7:14 - 7:15] -// CHECK: Punctuation: "(" [7:16 - 7:17] -// CHECK: Keyword: "struct" [7:17 - 7:23] +// CHECK: Punctuation: "=" [7:14 - 7:15] VarDecl=x:7:12 (Definition) +// CHECK: Punctuation: "(" [7:16 - 7:17] UnexposedExpr= +// CHECK: Keyword: "struct" [7:17 - 7:23] UnexposedExpr= // CHECK: Identifier: "X" [7:24 - 7:25] TypeRef=struct X:2:8 -// CHECK: Punctuation: ")" [7:25 - 7:26] -// CHECK: Punctuation: "{" [7:26 - 7:27] -// CHECK: Literal: "1" [7:27 - 7:28] -// CHECK: Punctuation: "," [7:28 - 7:29] -// CHECK: Literal: "2" [7:30 - 7:31] -// CHECK: Punctuation: "}" [7:31 - 7:32] -// CHECK: Punctuation: ";" [7:32 - 7:33] -// CHECK: Keyword: "void" [8:3 - 8:7] -// CHECK: Punctuation: "*" [8:8 - 8:9] +// CHECK: Punctuation: ")" [7:25 - 7:26] UnexposedExpr= +// CHECK: Punctuation: "{" [7:26 - 7:27] UnexposedExpr= +// CHECK: Literal: "1" [7:27 - 7:28] UnexposedExpr= +// CHECK: Punctuation: "," [7:28 - 7:29] UnexposedExpr= +// CHECK: Literal: "2" [7:30 - 7:31] UnexposedExpr= +// CHECK: Punctuation: "}" [7:31 - 7:32] UnexposedExpr= +// CHECK: Punctuation: ";" [7:32 - 7:33] UnexposedStmt= +// CHECK: Keyword: "void" [8:3 - 8:7] VarDecl=xx:8:9 (Definition) +// CHECK: Punctuation: "*" [8:8 - 8:9] VarDecl=xx:8:9 (Definition) // CHECK: Identifier: "xx" [8:9 - 8:11] VarDecl=xx:8:9 (Definition) -// CHECK: Punctuation: "=" [8:12 - 8:13] +// CHECK: Punctuation: "=" [8:12 - 8:13] VarDecl=xx:8:9 (Definition) // CHECK: Identifier: "ptr" [8:14 - 8:17] DeclRefExpr=ptr:3:14 -// CHECK: Punctuation: "?" [8:18 - 8:19] -// CHECK: Punctuation: ":" [8:20 - 8:21] -// CHECK: Punctuation: "&" [8:22 - 8:23] +// CHECK: Punctuation: "?" [8:18 - 8:19] UnexposedExpr= +// CHECK: Punctuation: ":" [8:20 - 8:21] UnexposedExpr= +// CHECK: Punctuation: "&" [8:22 - 8:23] UnexposedExpr= // CHECK: Identifier: "x" [8:23 - 8:24] DeclRefExpr=x:7:12 -// CHECK: Punctuation: ";" [8:24 - 8:25] -// CHECK: Keyword: "const" [9:3 - 9:8] -// CHECK: Keyword: "char" [9:9 - 9:13] -// CHECK: Punctuation: "*" [9:14 - 9:15] +// CHECK: Punctuation: ";" [8:24 - 8:25] UnexposedStmt= +// CHECK: Keyword: "const" [9:3 - 9:8] UnexposedStmt= +// CHECK: Keyword: "char" [9:9 - 9:13] VarDecl=hello:9:16 (Definition) +// CHECK: Punctuation: "*" [9:14 - 9:15] VarDecl=hello:9:16 (Definition) // CHECK: Identifier: "hello" [9:16 - 9:21] VarDecl=hello:9:16 (Definition) -// CHECK: Punctuation: "=" [9:22 - 9:23] -// CHECK: Literal: ""Hello"" [9:24 - 9:31] -// CHECK: Punctuation: ";" [9:31 - 9:32] -// CHECK: Punctuation: "}" [10:1 - 10:2] +// CHECK: Punctuation: "=" [9:22 - 9:23] VarDecl=hello:9:16 (Definition) +// CHECK: Literal: ""Hello"" [9:24 - 9:31] UnexposedExpr= +// CHECK: Punctuation: ";" [9:31 - 9:32] UnexposedStmt= +// CHECK: Punctuation: "}" [10:1 - 10:2] UnexposedStmt= // RUN: c-index-test -test-annotate-tokens=%s:4:1:165:32 %s | FileCheck %s // RUN: c-index-test -test-annotate-tokens=%s:4:1:165:38 %s | FileCheck %s diff --git a/test/Index/annotate-tokens.m b/test/Index/annotate-tokens.m index ce399d3..c6e746b 100644 --- a/test/Index/annotate-tokens.m +++ b/test/Index/annotate-tokens.m @@ -9,51 +9,245 @@ } @end -// RUN: c-index-test -test-annotate-tokens=%s:1:1:10:5 %s | FileCheck %s -// CHECK: Punctuation: "@" [1:1 - 1:2] -// CHECK: Identifier: "interface" [1:2 - 1:11] +// From <rdar://problem/7971430>, the 'barType' referenced in the ivar +// declarations should be annotated as TypeRefs. +typedef int * barType; +@interface Bar +{ + barType iVar; + barType iVar1, iVar2; +} +@end +@implementation Bar +- (void) method +{ + barType local = iVar; +} +@end + +// From <rdar://problem/7967123>. The ranges for attributes are not +// currently stored, causing most of the tokens to be falsely annotated. +// Since there are no source ranges for attributes, we currently don't +// annotate them. +@interface IBActionTests +- (IBAction) actionMethod:(id)arg; +- (void)foo:(int)x; +@end +extern int ibaction_test(void); +@implementation IBActionTests +- (IBAction) actionMethod:(id)arg +{ + ibaction_test(); + [self foo:0]; +} +- (void) foo:(int)x +{ + (void) x; +} +@end + +// From <rdar://problem/7961995>. Essentially the same issue as 7967123, +// but impacting code marked as IBOutlets. +@interface IBOutletTests +{ + IBOutlet char * anOutlet; +} +- (IBAction) actionMethod:(id)arg; +@property IBOutlet int * aPropOutlet; +@end + +// RUN: c-index-test -test-annotate-tokens=%s:1:1:58:1 %s -DIBOutlet='__attribute__((iboutlet))' -DIBAction='void)__attribute__((ibaction)' | FileCheck %s +// CHECK: Punctuation: "@" [1:1 - 1:2] ObjCInterfaceDecl=Foo:1:12 +// CHECK: Keyword: "interface" [1:2 - 1:11] ObjCInterfaceDecl=Foo:1:12 // CHECK: Identifier: "Foo" [1:12 - 1:15] ObjCInterfaceDecl=Foo:1:12 // CHECK: Punctuation: "-" [2:1 - 2:2] ObjCInstanceMethodDecl=compare::2:1 -// CHECK: Punctuation: "(" [2:3 - 2:4] -// CHECK: Keyword: "int" [2:4 - 2:7] -// CHECK: Punctuation: ")" [2:7 - 2:8] -// CHECK: Identifier: "compare" [2:8 - 2:15] -// CHECK: Punctuation: ":" [2:15 - 2:16] -// CHECK: Punctuation: "(" [2:16 - 2:17] +// CHECK: Punctuation: "(" [2:3 - 2:4] ObjCInstanceMethodDecl=compare::2:1 +// CHECK: Keyword: "int" [2:4 - 2:7] ObjCInstanceMethodDecl=compare::2:1 +// CHECK: Punctuation: ")" [2:7 - 2:8] ObjCInstanceMethodDecl=compare::2:1 +// CHECK: Identifier: "compare" [2:8 - 2:15] ObjCInstanceMethodDecl=compare::2:1 +// CHECK: Punctuation: ":" [2:15 - 2:16] ObjCInstanceMethodDecl=compare::2:1 +// CHECK: Punctuation: "(" [2:16 - 2:17] ObjCInstanceMethodDecl=compare::2:1 // CHECK: Identifier: "Foo" [2:17 - 2:20] ObjCClassRef=Foo:1:12 -// CHECK: Punctuation: "*" [2:20 - 2:21] -// CHECK: Punctuation: ")" [2:21 - 2:22] +// CHECK: Punctuation: "*" [2:20 - 2:21] ParmDecl=other:2:22 (Definition) +// CHECK: Punctuation: ")" [2:21 - 2:22] ParmDecl=other:2:22 (Definition) // CHECK: Identifier: "other" [2:22 - 2:27] ParmDecl=other:2:22 (Definition) -// CHECK: Punctuation: ";" [2:27 - 2:28] -// CHECK: Punctuation: "@" [3:1 - 3:2] -// CHECK: Identifier: "end" [3:2 - 3:5] +// CHECK: Punctuation: ";" [2:27 - 2:28] ObjCInstanceMethodDecl=compare::2:1 +// CHECK: Punctuation: "@" [3:1 - 3:2] ObjCInterfaceDecl=Foo:1:12 +// CHECK: Keyword: "end" [3:2 - 3:5] ObjCInterfaceDecl=Foo:1:12 // CHECK: Punctuation: "@" [5:1 - 5:2] ObjCImplementationDecl=Foo:5:1 (Definition) -// CHECK: Identifier: "implementation" [5:2 - 5:16] -// CHECK: Identifier: "Foo" [5:17 - 5:20] +// CHECK: Keyword: "implementation" [5:2 - 5:16] ObjCImplementationDecl=Foo:5:1 (Definition) +// CHECK: Identifier: "Foo" [5:17 - 5:20] ObjCImplementationDecl=Foo:5:1 (Definition) // CHECK: Punctuation: "-" [6:1 - 6:2] ObjCInstanceMethodDecl=compare::6:1 (Definition) -// CHECK: Punctuation: "(" [6:3 - 6:4] -// CHECK: Keyword: "int" [6:4 - 6:7] -// CHECK: Punctuation: ")" [6:7 - 6:8] -// CHECK: Identifier: "compare" [6:8 - 6:15] -// CHECK: Punctuation: ":" [6:15 - 6:16] -// CHECK: Punctuation: "(" [6:16 - 6:17] +// CHECK: Punctuation: "(" [6:3 - 6:4] ObjCInstanceMethodDecl=compare::6:1 (Definition) +// CHECK: Keyword: "int" [6:4 - 6:7] ObjCInstanceMethodDecl=compare::6:1 (Definition) +// CHECK: Punctuation: ")" [6:7 - 6:8] ObjCInstanceMethodDecl=compare::6:1 (Definition) +// CHECK: Identifier: "compare" [6:8 - 6:15] ObjCInstanceMethodDecl=compare::6:1 (Definition) +// CHECK: Punctuation: ":" [6:15 - 6:16] ObjCInstanceMethodDecl=compare::6:1 (Definition) +// CHECK: Punctuation: "(" [6:16 - 6:17] ObjCInstanceMethodDecl=compare::6:1 (Definition) // CHECK: Identifier: "Foo" [6:17 - 6:20] ObjCClassRef=Foo:1:12 -// CHECK: Punctuation: "*" [6:20 - 6:21] -// CHECK: Punctuation: ")" [6:21 - 6:22] +// CHECK: Punctuation: "*" [6:20 - 6:21] ParmDecl=other:6:22 (Definition) +// CHECK: Punctuation: ")" [6:21 - 6:22] ParmDecl=other:6:22 (Definition) // CHECK: Identifier: "other" [6:22 - 6:27] ParmDecl=other:6:22 (Definition) -// CHECK: Punctuation: "{" [6:28 - 6:29] -// CHECK: Keyword: "return" [7:3 - 7:9] -// CHECK: Literal: "0" [7:10 - 7:11] -// CHECK: Punctuation: ";" [7:11 - 7:12] -// CHECK: Punctuation: "(" [8:3 - 8:4] -// CHECK: Keyword: "void" [8:4 - 8:8] -// CHECK: Punctuation: ")" [8:8 - 8:9] -// CHECK: Punctuation: "@" [8:9 - 8:10] -// CHECK: Identifier: "encode" [8:10 - 8:16] -// CHECK: Punctuation: "(" [8:16 - 8:17] +// CHECK: Punctuation: "{" [6:28 - 6:29] UnexposedStmt= +// CHECK: Keyword: "return" [7:3 - 7:9] UnexposedStmt= +// CHECK: Literal: "0" [7:10 - 7:11] UnexposedExpr= +// CHECK: Punctuation: ";" [7:11 - 7:12] UnexposedStmt= +// CHECK: Punctuation: "(" [8:3 - 8:4] UnexposedExpr= +// CHECK: Keyword: "void" [8:4 - 8:8] UnexposedExpr= +// CHECK: Punctuation: ")" [8:8 - 8:9] UnexposedExpr= +// CHECK: Punctuation: "@" [8:9 - 8:10] UnexposedExpr= +// CHECK: Keyword: "encode" [8:10 - 8:16] UnexposedExpr= +// CHECK: Punctuation: "(" [8:16 - 8:17] UnexposedExpr= // CHECK: Identifier: "Foo" [8:17 - 8:20] ObjCClassRef=Foo:1:12 -// CHECK: Punctuation: ")" [8:20 - 8:21] -// CHECK: Punctuation: ";" [8:21 - 8:22] -// CHECK: Punctuation: "}" [9:1 - 9:2] -// CHECK: Punctuation: "@" [10:1 - 10:2] -// CHECK: Identifier: "end" [10:2 - 10:5] +// CHECK: Punctuation: ")" [8:20 - 8:21] UnexposedExpr= +// CHECK: Punctuation: ";" [8:21 - 8:22] UnexposedStmt= +// CHECK: Punctuation: "}" [9:1 - 9:2] UnexposedStmt= +// CHECK: Punctuation: "@" [10:1 - 10:2] ObjCImplementationDecl=Foo:5:1 (Definition) +// CHECK: Keyword: "end" [10:2 - 10:5] +// CHECK: Keyword: "typedef" [14:1 - 14:8] +// CHECK: Keyword: "int" [14:9 - 14:12] +// CHECK: Punctuation: "*" [14:13 - 14:14] +// CHECK: Identifier: "barType" [14:15 - 14:22] TypedefDecl=barType:14:15 (Definition) +// CHECK: Punctuation: ";" [14:22 - 14:23] +// CHECK: Punctuation: "@" [15:1 - 15:2] ObjCInterfaceDecl=Bar:15:12 +// CHECK: Keyword: "interface" [15:2 - 15:11] ObjCInterfaceDecl=Bar:15:12 +// CHECK: Identifier: "Bar" [15:12 - 15:15] ObjCInterfaceDecl=Bar:15:12 +// CHECK: Punctuation: "{" [16:1 - 16:2] ObjCInterfaceDecl=Bar:15:12 +// CHECK: Identifier: "barType" [17:5 - 17:12] TypeRef=barType:14:15 +// CHECK: Identifier: "iVar" [17:13 - 17:17] ObjCIvarDecl=iVar:17:13 (Definition) +// CHECK: Punctuation: ";" [17:17 - 17:18] ObjCInterfaceDecl=Bar:15:12 +// CHECK: Identifier: "barType" [18:5 - 18:12] TypeRef=barType:14:15 +// CHECK: Identifier: "iVar1" [18:13 - 18:18] ObjCIvarDecl=iVar1:18:13 (Definition) +// CHECK: Punctuation: "," [18:18 - 18:19] ObjCIvarDecl=iVar2:18:20 (Definition) +// CHECK: Identifier: "iVar2" [18:20 - 18:25] ObjCIvarDecl=iVar2:18:20 (Definition) +// CHECK: Punctuation: ";" [18:25 - 18:26] ObjCInterfaceDecl=Bar:15:12 +// CHECK: Punctuation: "}" [19:1 - 19:2] ObjCInterfaceDecl=Bar:15:12 +// CHECK: Punctuation: "@" [20:1 - 20:2] ObjCInterfaceDecl=Bar:15:12 +// CHECK: Keyword: "end" [20:2 - 20:5] ObjCInterfaceDecl=Bar:15:12 +// CHECK: Punctuation: "@" [21:1 - 21:2] ObjCImplementationDecl=Bar:21:1 (Definition) +// CHECK: Keyword: "implementation" [21:2 - 21:16] ObjCImplementationDecl=Bar:21:1 (Definition) +// CHECK: Identifier: "Bar" [21:17 - 21:20] ObjCImplementationDecl=Bar:21:1 (Definition) +// CHECK: Punctuation: "-" [22:1 - 22:2] ObjCInstanceMethodDecl=method:22:1 (Definition) +// CHECK: Punctuation: "(" [22:3 - 22:4] ObjCInstanceMethodDecl=method:22:1 (Definition) +// CHECK: Keyword: "void" [22:4 - 22:8] ObjCInstanceMethodDecl=method:22:1 (Definition) +// CHECK: Punctuation: ")" [22:8 - 22:9] ObjCInstanceMethodDecl=method:22:1 (Definition) +// CHECK: Identifier: "method" [22:10 - 22:16] ObjCInstanceMethodDecl=method:22:1 (Definition) +// CHECK: Punctuation: "{" [23:1 - 23:2] UnexposedStmt= +// CHECK: Identifier: "barType" [24:5 - 24:12] TypeRef=barType:14:15 +// CHECK: Identifier: "local" [24:13 - 24:18] VarDecl=local:24:13 (Definition) +// CHECK: Punctuation: "=" [24:19 - 24:20] VarDecl=local:24:13 (Definition) +// CHECK: Identifier: "iVar" [24:21 - 24:25] MemberRefExpr=iVar:17:13 +// CHECK: Punctuation: ";" [24:25 - 24:26] UnexposedStmt= +// CHECK: Punctuation: "}" [25:1 - 25:2] UnexposedStmt= +// CHECK: Punctuation: "@" [26:1 - 26:2] ObjCImplementationDecl=Bar:21:1 (Definition) +// CHECK: Keyword: "end" [26:2 - 26:5] +// CHECK: Punctuation: "@" [32:1 - 32:2] ObjCInterfaceDecl=IBActionTests:32:12 +// CHECK: Keyword: "interface" [32:2 - 32:11] ObjCInterfaceDecl=IBActionTests:32:12 +// CHECK: Identifier: "IBActionTests" [32:12 - 32:25] ObjCInterfaceDecl=IBActionTests:32:12 +// CHECK: Punctuation: "-" [33:1 - 33:2] ObjCInstanceMethodDecl=actionMethod::33:1 +// CHECK: Punctuation: "(" [33:3 - 33:4] ObjCInstanceMethodDecl=actionMethod::33:1 +// CHECK: Identifier: "IBAction" [33:4 - 33:12] macro instantiation=IBAction +// CHECK: Punctuation: ")" [33:12 - 33:13] ObjCInstanceMethodDecl=actionMethod::33:1 +// CHECK: Identifier: "actionMethod" [33:14 - 33:26] ObjCInstanceMethodDecl=actionMethod::33:1 +// CHECK: Punctuation: ":" [33:26 - 33:27] ObjCInstanceMethodDecl=actionMethod::33:1 +// CHECK: Punctuation: "(" [33:27 - 33:28] ObjCInstanceMethodDecl=actionMethod::33:1 +// CHECK: Identifier: "id" [33:28 - 33:30] TypeRef=id:0:0 +// CHECK: Punctuation: ")" [33:30 - 33:31] ParmDecl=arg:33:31 (Definition) +// CHECK: Identifier: "arg" [33:31 - 33:34] ParmDecl=arg:33:31 (Definition) +// CHECK: Punctuation: ";" [33:34 - 33:35] ObjCInstanceMethodDecl=actionMethod::33:1 +// CHECK: Punctuation: "-" [34:1 - 34:2] ObjCInstanceMethodDecl=foo::34:1 +// CHECK: Punctuation: "(" [34:3 - 34:4] ObjCInstanceMethodDecl=foo::34:1 +// CHECK: Keyword: "void" [34:4 - 34:8] ObjCInstanceMethodDecl=foo::34:1 +// CHECK: Punctuation: ")" [34:8 - 34:9] ObjCInstanceMethodDecl=foo::34:1 +// CHECK: Identifier: "foo" [34:9 - 34:12] ObjCInstanceMethodDecl=foo::34:1 +// CHECK: Punctuation: ":" [34:12 - 34:13] ObjCInstanceMethodDecl=foo::34:1 +// CHECK: Punctuation: "(" [34:13 - 34:14] ObjCInstanceMethodDecl=foo::34:1 +// CHECK: Keyword: "int" [34:14 - 34:17] ParmDecl=x:34:18 (Definition) +// CHECK: Punctuation: ")" [34:17 - 34:18] ParmDecl=x:34:18 (Definition) +// CHECK: Identifier: "x" [34:18 - 34:19] ParmDecl=x:34:18 (Definition) +// CHECK: Punctuation: ";" [34:19 - 34:20] ObjCInstanceMethodDecl=foo::34:1 +// CHECK: Punctuation: "@" [35:1 - 35:2] ObjCInterfaceDecl=IBActionTests:32:12 +// CHECK: Keyword: "end" [35:2 - 35:5] ObjCInterfaceDecl=IBActionTests:32:12 +// CHECK: Keyword: "extern" [36:1 - 36:7] +// CHECK: Keyword: "int" [36:8 - 36:11] FunctionDecl=ibaction_test:36:12 +// CHECK: Identifier: "ibaction_test" [36:12 - 36:25] FunctionDecl=ibaction_test:36:12 +// CHECK: Punctuation: "(" [36:25 - 36:26] FunctionDecl=ibaction_test:36:12 +// CHECK: Keyword: "void" [36:26 - 36:30] FunctionDecl=ibaction_test:36:12 +// CHECK: Punctuation: ")" [36:30 - 36:31] FunctionDecl=ibaction_test:36:12 +// CHECK: Punctuation: ";" [36:31 - 36:32] +// CHECK: Punctuation: "@" [37:1 - 37:2] ObjCImplementationDecl=IBActionTests:37:1 (Definition) +// CHECK: Keyword: "implementation" [37:2 - 37:16] ObjCImplementationDecl=IBActionTests:37:1 (Definition) +// CHECK: Identifier: "IBActionTests" [37:17 - 37:30] ObjCImplementationDecl=IBActionTests:37:1 (Definition) +// CHECK: Punctuation: "-" [38:1 - 38:2] ObjCInstanceMethodDecl=actionMethod::38:1 (Definition) +// CHECK: Punctuation: "(" [38:3 - 38:4] ObjCInstanceMethodDecl=actionMethod::38:1 (Definition) +// CHECK: Identifier: "IBAction" [38:4 - 38:12] macro instantiation=IBAction +// CHECK: Punctuation: ")" [38:12 - 38:13] ObjCInstanceMethodDecl=actionMethod::38:1 (Definition) +// CHECK: Identifier: "actionMethod" [38:14 - 38:26] ObjCInstanceMethodDecl=actionMethod::38:1 (Definition) +// CHECK: Punctuation: ":" [38:26 - 38:27] ObjCInstanceMethodDecl=actionMethod::38:1 (Definition) +// CHECK: Punctuation: "(" [38:27 - 38:28] ObjCInstanceMethodDecl=actionMethod::38:1 (Definition) +// CHECK: Identifier: "id" [38:28 - 38:30] TypeRef=id:0:0 +// CHECK: Punctuation: ")" [38:30 - 38:31] ParmDecl=arg:38:31 (Definition) +// CHECK: Identifier: "arg" [38:31 - 38:34] ParmDecl=arg:38:31 (Definition) +// CHECK: Punctuation: "{" [39:1 - 39:2] UnexposedStmt= +// CHECK: Identifier: "ibaction_test" [40:5 - 40:18] DeclRefExpr=ibaction_test:36:12 +// CHECK: Punctuation: "(" [40:18 - 40:19] CallExpr=ibaction_test:36:12 +// CHECK: Punctuation: ")" [40:19 - 40:20] CallExpr=ibaction_test:36:12 +// CHECK: Punctuation: ";" [40:20 - 40:21] UnexposedStmt= +// CHECK: Punctuation: "[" [41:5 - 41:6] ObjCMessageExpr=foo::34:1 +// CHECK: Identifier: "self" [41:6 - 41:10] DeclRefExpr=self:0:0 +// CHECK: Identifier: "foo" [41:11 - 41:14] ObjCMessageExpr=foo::34:1 +// CHECK: Punctuation: ":" [41:14 - 41:15] ObjCMessageExpr=foo::34:1 +// CHECK: Literal: "0" [41:15 - 41:16] UnexposedExpr= +// CHECK: Punctuation: "]" [41:16 - 41:17] ObjCMessageExpr=foo::34:1 +// CHECK: Punctuation: ";" [41:17 - 41:18] UnexposedStmt= +// CHECK: Punctuation: "}" [42:1 - 42:2] UnexposedStmt= +// CHECK: Punctuation: "-" [43:1 - 43:2] ObjCInstanceMethodDecl=foo::43:1 (Definition) +// CHECK: Punctuation: "(" [43:3 - 43:4] ObjCInstanceMethodDecl=foo::43:1 (Definition) +// CHECK: Keyword: "void" [43:4 - 43:8] ObjCInstanceMethodDecl=foo::43:1 (Definition) +// CHECK: Punctuation: ")" [43:8 - 43:9] ObjCInstanceMethodDecl=foo::43:1 (Definition) +// CHECK: Identifier: "foo" [43:10 - 43:13] ObjCInstanceMethodDecl=foo::43:1 (Definition) +// CHECK: Punctuation: ":" [43:13 - 43:14] ObjCInstanceMethodDecl=foo::43:1 (Definition) +// CHECK: Punctuation: "(" [43:14 - 43:15] ObjCInstanceMethodDecl=foo::43:1 (Definition) +// CHECK: Keyword: "int" [43:15 - 43:18] ParmDecl=x:43:19 (Definition) +// CHECK: Punctuation: ")" [43:18 - 43:19] ParmDecl=x:43:19 (Definition) +// CHECK: Identifier: "x" [43:19 - 43:20] ParmDecl=x:43:19 (Definition) +// CHECK: Punctuation: "{" [44:1 - 44:2] UnexposedStmt= +// CHECK: Punctuation: "(" [45:3 - 45:4] UnexposedExpr=x:43:19 +// CHECK: Keyword: "void" [45:4 - 45:8] UnexposedExpr=x:43:19 +// CHECK: Punctuation: ")" [45:8 - 45:9] UnexposedExpr=x:43:19 +// CHECK: Identifier: "x" [45:10 - 45:11] DeclRefExpr=x:43:19 +// CHECK: Punctuation: ";" [45:11 - 45:12] UnexposedStmt= +// CHECK: Punctuation: "}" [46:1 - 46:2] UnexposedStmt= +// CHECK: Punctuation: "@" [47:1 - 47:2] ObjCImplementationDecl=IBActionTests:37:1 (Definition) +// CHECK: Keyword: "end" [47:2 - 47:5] +// CHECK: Punctuation: "@" [51:1 - 51:2] ObjCInterfaceDecl=IBOutletTests:51:12 +// CHECK: Keyword: "interface" [51:2 - 51:11] ObjCInterfaceDecl=IBOutletTests:51:12 +// CHECK: Identifier: "IBOutletTests" [51:12 - 51:25] ObjCInterfaceDecl=IBOutletTests:51:12 +// CHECK: Punctuation: "{" [52:1 - 52:2] ObjCInterfaceDecl=IBOutletTests:51:12 +// CHECK: Identifier: "IBOutlet" [53:5 - 53:13] macro instantiation=IBOutlet:{{[0-9]+}}:{{[0-9]+}} +// CHECK: Keyword: "char" [53:14 - 53:18] ObjCIvarDecl=anOutlet:53:21 (Definition) +// CHECK: Punctuation: "*" [53:19 - 53:20] ObjCIvarDecl=anOutlet:53:21 (Definition) +// CHECK: Identifier: "anOutlet" [53:21 - 53:29] ObjCIvarDecl=anOutlet:53:21 (Definition) +// CHECK: Punctuation: ";" [53:29 - 53:30] ObjCInterfaceDecl=IBOutletTests:51:12 +// CHECK: Punctuation: "}" [54:1 - 54:2] ObjCInterfaceDecl=IBOutletTests:51:12 +// CHECK: Punctuation: "-" [55:1 - 55:2] ObjCInterfaceDecl=IBOutletTests:51:12 +// CHECK: Punctuation: "(" [55:3 - 55:4] ObjCInterfaceDecl=IBOutletTests:51:12 +// CHECK: Identifier: "IBAction" [55:4 - 55:12] macro instantiation=IBAction +// CHECK: Punctuation: ")" [55:12 - 55:13] ObjCInterfaceDecl=IBOutletTests:51:12 +// CHECK: Identifier: "actionMethod" [55:14 - 55:26] ObjCInterfaceDecl=IBOutletTests:51:12 +// CHECK: Punctuation: ":" [55:26 - 55:27] ObjCInterfaceDecl=IBOutletTests:51:12 +// CHECK: Punctuation: "(" [55:27 - 55:28] ObjCInterfaceDecl=IBOutletTests:51:12 +// CHECK: Identifier: "id" [55:28 - 55:30] ObjCInterfaceDecl=IBOutletTests:51:12 +// CHECK: Punctuation: ")" [55:30 - 55:31] ObjCInterfaceDecl=IBOutletTests:51:12 +// CHECK: Identifier: "arg" [55:31 - 55:34] ObjCInterfaceDecl=IBOutletTests:51:12 +// CHECK: Punctuation: ";" [55:34 - 55:35] ObjCInterfaceDecl=IBOutletTests:51:12 +// CHECK: Punctuation: "@" [56:1 - 56:2] ObjCInterfaceDecl=IBOutletTests:51:12 +// CHECK: Keyword: "property" [56:2 - 56:10] ObjCInterfaceDecl=IBOutletTests:51:12 +// CHECK: Identifier: "IBOutlet" [56:11 - 56:19] macro instantiation=IBOutlet:{{[0-9]+}}:{{[0-9]+}} +// CHECK: Keyword: "int" [56:20 - 56:23] ObjCInterfaceDecl=IBOutletTests:51:12 +// CHECK: Punctuation: "*" [56:24 - 56:25] ObjCInterfaceDecl=IBOutletTests:51:12 +// CHECK: Identifier: "aPropOutlet" [56:26 - 56:37] ObjCPropertyDecl=aPropOutlet:56:26 +// CHECK: Punctuation: ";" [56:37 - 56:38] ObjCInterfaceDecl=IBOutletTests:51:12 +// CHECK: Punctuation: "@" [57:1 - 57:2] ObjCInterfaceDecl=IBOutletTests:51:12 +// CHECK: Keyword: "end" [57:2 - 57:5] ObjCInterfaceDecl=IBOutletTests:51:12 + diff --git a/test/Index/c-index-api-loadTU-test.m b/test/Index/c-index-api-loadTU-test.m index 5b2f86e..22875db 100644 --- a/test/Index/c-index-api-loadTU-test.m +++ b/test/Index/c-index-api-loadTU-test.m @@ -54,12 +54,24 @@ int main (int argc, const char * argv[]) { main(someEnum, (const char **)bee); } +// Test attribute traversal. +#define IBOutlet __attribute__((iboutlet)) +#define IBOutletCollection(ClassName) __attribute__((iboutletcollection)) +#define IBAction void)__attribute__((ibaction) + +@interface TestAttributes { + IBOutlet char * anOutlet; + IBOutletCollection(id) id anOutletCollection; +} +- (IBAction) actionMethod:(id)arg; +@end + // CHECK: c-index-api-loadTU-test.m:4:12: ObjCInterfaceDecl=Foo:4:12 Extent=[4:1 - 12:5] // CHECK: c-index-api-loadTU-test.m:6:32: ObjCIvarDecl=myoutlet:6:32 (Definition) Extent=[6:32 - 6:40] -// CHECK: c-index-api-loadTU-test.m:6:32: attribute(iboutlet)= Extent=[6:32 - 6:40] +// CHECK: <invalid loc>:0:0: attribute(iboutlet)= // CHECK: c-index-api-loadTU-test.m:6:29: TypeRef=id:0:0 Extent=[6:29 - 6:31] // CHECK: c-index-api-loadTU-test.m:8:1: ObjCInstanceMethodDecl=myMessage::8:1 Extent=[8:1 - 8:54] -// CHECK: c-index-api-loadTU-test.m:8:1: attribute(ibaction)= Extent=[8:1 - 8:54] +// CHECK: <invalid loc>:0:0: attribute(ibaction)= // CHECK: c-index-api-loadTU-test.m:8:50: ParmDecl=msg:8:50 (Definition) Extent=[8:47 - 8:53] // CHECK: c-index-api-loadTU-test.m:8:47: TypeRef=id:0:0 Extent=[8:47 - 8:49] // CHECK: c-index-api-loadTU-test.m:9:1: ObjCInstanceMethodDecl=foo:9:1 Extent=[9:1 - 9:7] @@ -81,27 +93,29 @@ int main (int argc, const char * argv[]) { // CHECK: c-index-api-loadTU-test.m:33:23: ObjCProtocolRef=SubP:29:1 Extent=[33:23 - 33:27] // CHECK: c-index-api-loadTU-test.m:35:9: ObjCIvarDecl=_anIVar:35:9 (Definition) Extent=[35:9 - 35:16] // CHECK: c-index-api-loadTU-test.m:38:1: ObjCInstanceMethodDecl=bazMethod:38:1 Extent=[38:1 - 38:21] +// CHECK: c-index-api-loadTU-test.m:38:4: ObjCClassRef=Foo:4:12 Extent=[38:4 - 38:7] // CHECK: c-index-api-loadTU-test.m:42:1: EnumDecl=:42:1 (Definition) Extent=[42:1 - 44:2] // CHECK: c-index-api-loadTU-test.m:43:3: EnumConstantDecl=someEnum:43:3 (Definition) Extent=[43:3 - 43:11] // CHECK: c-index-api-loadTU-test.m:46:5: FunctionDecl=main:46:5 (Definition) Extent=[46:5 - 55:2] // CHECK: c-index-api-loadTU-test.m:46:15: ParmDecl=argc:46:15 (Definition) Extent=[46:11 - 46:19] // CHECK: c-index-api-loadTU-test.m:46:34: ParmDecl=argv:46:34 (Definition) Extent=[46:27 - 46:38] -// CHECK: c-index-api-loadTU-test.m:46:5: UnexposedStmt= Extent=[46:42 - 55:2] -// CHECK: c-index-api-loadTU-test.m:46:5: UnexposedStmt= Extent=[47:2 - 47:12] +// CHECK: <invalid loc>:0:0: UnexposedStmt= Extent=[46:42 - 55:2] +// CHECK: <invalid loc>:0:0: UnexposedStmt= Extent=[47:2 - 47:12] // CHECK: c-index-api-loadTU-test.m:47:8: VarDecl=bee:47:8 (Definition) Extent=[47:2 - 47:11] // CHECK: c-index-api-loadTU-test.m:47:2: ObjCClassRef=Baz:33:12 Extent=[47:2 - 47:5] -// CHECK: c-index-api-loadTU-test.m:47:8: UnexposedStmt= Extent=[48:2 - 48:19] +// CHECK: <invalid loc>:0:0: UnexposedStmt= Extent=[48:2 - 48:19] // CHECK: c-index-api-loadTU-test.m:48:5: VarDecl=a:48:5 (Definition) Extent=[48:2 - 48:18] // CHECK: c-index-api-loadTU-test.m:48:2: TypeRef=id:0:0 Extent=[48:2 - 48:4] // CHECK: c-index-api-loadTU-test.m:48:9: ObjCMessageExpr=foo:9:1 Extent=[48:9 - 48:18] // CHECK: c-index-api-loadTU-test.m:48:10: DeclRefExpr=bee:47:8 Extent=[48:10 - 48:13] -// CHECK: c-index-api-loadTU-test.m:48:5: UnexposedStmt= Extent=[49:2 - 49:27] +// CHECK: <invalid loc>:0:0: UnexposedStmt= Extent=[49:2 - 49:27] // CHECK: c-index-api-loadTU-test.m:49:12: VarDecl=c:49:12 (Definition) Extent=[49:2 - 49:26] // CHECK: c-index-api-loadTU-test.m:49:2: TypeRef=id:0:0 Extent=[49:2 - 49:4] // CHECK: c-index-api-loadTU-test.m:49:6: ObjCProtocolRef=SubP:29:1 Extent=[49:6 - 49:10] // CHECK: c-index-api-loadTU-test.m:49:16: UnexposedExpr=fooC:10:1 Extent=[49:16 - 49:26] // CHECK: c-index-api-loadTU-test.m:49:16: ObjCMessageExpr=fooC:10:1 Extent=[49:16 - 49:26] -// CHECK: c-index-api-loadTU-test.m:49:12: UnexposedStmt= Extent=[50:2 - 50:15] +// CHECK: c-index-api-loadTU-test.m:49:17: ObjCClassRef=Foo:4:12 Extent=[49:17 - 49:20] +// CHECK: <invalid loc>:0:0: UnexposedStmt= Extent=[50:2 - 50:15] // CHECK: c-index-api-loadTU-test.m:50:13: VarDecl=d:50:13 (Definition) Extent=[50:2 - 50:14] // CHECK: c-index-api-loadTU-test.m:50:2: TypeRef=id:0:0 Extent=[50:2 - 50:4] // CHECK: c-index-api-loadTU-test.m:50:6: ObjCProtocolRef=Proto:25:1 Extent=[50:6 - 50:11] @@ -121,4 +135,14 @@ int main (int argc, const char * argv[]) { // CHECK: c-index-api-loadTU-test.m:54:8: DeclRefExpr=someEnum:43:3 Extent=[54:8 - 54:16] // CHECK: c-index-api-loadTU-test.m:54:18: UnexposedExpr=bee:47:8 Extent=[54:18 - 54:36] // CHECK: c-index-api-loadTU-test.m:54:33: DeclRefExpr=bee:47:8 Extent=[54:33 - 54:36] +// CHECK: c-index-api-loadTU-test.m:62:12: ObjCInterfaceDecl=TestAttributes:62:12 Extent=[62:1 - 67:5] +// CHECK: c-index-api-loadTU-test.m:63:19: ObjCIvarDecl=anOutlet:63:19 (Definition) Extent=[63:19 - 63:27] +// CHECK: <invalid loc>:0:0: attribute(iboutlet)= +// CHECK: c-index-api-loadTU-test.m:64:29: ObjCIvarDecl=anOutletCollection:64:29 (Definition) Extent=[64:29 - 64:47] +// CHECK: <invalid loc>:0:0: attribute(iboutletcollection)= +// CHECK: c-index-api-loadTU-test.m:64:26: TypeRef=id:0:0 Extent=[64:26 - 64:28] +// CHECK: c-index-api-loadTU-test.m:66:1: ObjCInstanceMethodDecl=actionMethod::66:1 Extent=[66:1 - 66:35] +// CHECK: <invalid loc>:0:0: attribute(ibaction)= +// CHECK: c-index-api-loadTU-test.m:66:31: ParmDecl=arg:66:31 (Definition) Extent=[66:28 - 66:34] +// CHECK: c-index-api-loadTU-test.m:66:28: TypeRef=id:0:0 Extent=[66:28 - 66:30] diff --git a/test/Index/complete-at-directives.m b/test/Index/complete-at-directives.m index 811bca0..a278ce8 100644 --- a/test/Index/complete-at-directives.m +++ b/test/Index/complete-at-directives.m @@ -5,25 +5,25 @@ @implementation MyClass @end -// RUN: c-index-test -code-completion-at=%s:2:2 %s | FileCheck -check-prefix=CHECK-CC1 %s +// RUN: c-index-test -code-completion-at=%s:2:2 -Xclang -code-completion-patterns %s | FileCheck -check-prefix=CHECK-CC1 %s // CHECK-CC1: {TypedText class}{HorizontalSpace }{Placeholder identifier} // CHECK-CC1: {TypedText compatibility_alias}{HorizontalSpace }{Placeholder alias}{HorizontalSpace }{Placeholder class} // CHECK-CC1: {TypedText implementation}{HorizontalSpace }{Placeholder class} // CHECK-CC1: {TypedText interface}{HorizontalSpace }{Placeholder class} // CHECK-CC1: {TypedText protocol}{HorizontalSpace }{Placeholder protocol} -// RUN: c-index-test -code-completion-at=%s:3:2 %s | FileCheck -check-prefix=CHECK-CC2 %s +// RUN: c-index-test -code-completion-at=%s:3:2 -Xclang -code-completion-patterns %s | FileCheck -check-prefix=CHECK-CC2 %s // CHECK-CC2: {TypedText end} // CHECK-CC2: {TypedText optional} // CHECK-CC2: {TypedText property} // CHECK-CC2: {TypedText required} -// RUN: c-index-test -code-completion-at=%s:6:2 %s | FileCheck -check-prefix=CHECK-CC3 %s +// RUN: c-index-test -code-completion-at=%s:6:2 -Xclang -code-completion-patterns %s | FileCheck -check-prefix=CHECK-CC3 %s // CHECK-CC3: {TypedText dynamic}{HorizontalSpace }{Placeholder property} // CHECK-CC3: {TypedText end} // CHECK-CC3: {TypedText synthesize}{HorizontalSpace }{Placeholder property} -// RUN: c-index-test -code-completion-at=%s:2:1 %s | FileCheck -check-prefix=CHECK-CC4 %s +// RUN: c-index-test -code-completion-at=%s:2:1 -Xclang -code-completion-patterns %s | FileCheck -check-prefix=CHECK-CC4 %s // CHECK-CC4: NotImplemented:{TypedText @class}{HorizontalSpace }{Placeholder identifier} // CHECK-CC4: NotImplemented:{TypedText @compatibility_alias}{HorizontalSpace }{Placeholder alias}{HorizontalSpace }{Placeholder class} // CHECK-CC4: NotImplemented:{TypedText @implementation}{HorizontalSpace }{Placeholder class} @@ -34,7 +34,7 @@ // CHECK-CC4: TypedefDecl:{TypedText id} // CHECK-CC4: TypedefDecl:{TypedText SEL} -// RUN: c-index-test -code-completion-at=%s:3:1 %s | FileCheck -check-prefix=CHECK-CC5 %s +// RUN: c-index-test -code-completion-at=%s:3:1 -Xclang -code-completion-patterns %s | FileCheck -check-prefix=CHECK-CC5 %s // CHECK-CC5: {TypedText @end} // CHECK-CC5: {TypedText @optional} // CHECK-CC5: {TypedText @property} @@ -45,13 +45,13 @@ // CHECK-CC5: ObjCInterfaceDecl:{TypedText MyClass} // CHECK-CC5: TypedefDecl:{TypedText SEL} -// RUN: c-index-test -code-completion-at=%s:2:23 %s | FileCheck -check-prefix=CHECK-CC6 %s +// RUN: c-index-test -code-completion-at=%s:2:23 -Xclang -code-completion-patterns %s | FileCheck -check-prefix=CHECK-CC6 %s // CHECK-CC6: NotImplemented:{TypedText package} // CHECK-CC6: NotImplemented:{TypedText private} // CHECK-CC6: NotImplemented:{TypedText protected} // CHECK-CC6: NotImplemented:{TypedText public} -// RUN: c-index-test -code-completion-at=%s:2:22 %s | FileCheck -check-prefix=CHECK-CC7 %s +// RUN: c-index-test -code-completion-at=%s:2:22 -Xclang -code-completion-patterns %s | FileCheck -check-prefix=CHECK-CC7 %s // CHECK-CC7: NotImplemented:{TypedText @package} // CHECK-CC7: NotImplemented:{TypedText @private} // CHECK-CC7: NotImplemented:{TypedText @protected} diff --git a/test/Index/complete-at-exprstmt.m b/test/Index/complete-at-exprstmt.m index 87e554f..8537098 100644 --- a/test/Index/complete-at-exprstmt.m +++ b/test/Index/complete-at-exprstmt.m @@ -9,18 +9,18 @@ @synchronized (@encode(MyClass)) { } } @end -// RUN: c-index-test -code-completion-at=%s:9:4 %s | FileCheck -check-prefix=CHECK-CC1 %s +// RUN: c-index-test -code-completion-at=%s:9:4 -Xclang -code-completion-patterns %s | FileCheck -check-prefix=CHECK-CC1 %s // CHECK-CC1: {TypedText encode}{LeftParen (}{Placeholder type-name}{RightParen )} // CHECK-CC1: {TypedText protocol}{LeftParen (}{Placeholder protocol-name}{RightParen )} // CHECK-CC1: {TypedText selector}{LeftParen (}{Placeholder selector}{RightParen )} // CHECK-CC1: {TypedText synchronized}{HorizontalSpace }{LeftParen (}{Placeholder expression}{RightParen )}{LeftBrace {}{Placeholder statements}{RightBrace }} // CHECK-CC1: {TypedText throw}{HorizontalSpace }{Placeholder expression} // CHECK-CC1: {TypedText try}{LeftBrace {}{Placeholder statements}{RightBrace }}{Text @catch}{LeftParen (}{Placeholder parameter}{RightParen )}{LeftBrace {}{Placeholder statements}{RightBrace }}{Text @finally}{LeftBrace {}{Placeholder statements}{RightBrace }} -// RUN: c-index-test -code-completion-at=%s:9:19 %s | FileCheck -check-prefix=CHECK-CC2 %s +// RUN: c-index-test -code-completion-at=%s:9:19 -Xclang -code-completion-patterns %s | FileCheck -check-prefix=CHECK-CC2 %s // CHECK-CC2: {TypedText encode}{LeftParen (}{Placeholder type-name}{RightParen )} // CHECK-CC2: {TypedText protocol}{LeftParen (}{Placeholder protocol-name}{RightParen )} // CHECK-CC2: {TypedText selector}{LeftParen (}{Placeholder selector}{RightParen )} -// RUN: c-index-test -code-completion-at=%s:9:3 %s | FileCheck -check-prefix=CHECK-CC3 %s +// RUN: c-index-test -code-completion-at=%s:9:3 -Xclang -code-completion-patterns %s | FileCheck -check-prefix=CHECK-CC3 %s // CHECK-CC3: NotImplemented:{TypedText @encode}{LeftParen (}{Placeholder type-name}{RightParen )} // CHECK-CC3: NotImplemented:{TypedText @protocol}{LeftParen (}{Placeholder protocol-name}{RightParen )} // CHECK-CC3: NotImplemented:{TypedText @selector}{LeftParen (}{Placeholder selector}{RightParen )} diff --git a/test/Index/complete-exprs.c b/test/Index/complete-exprs.c index efc82f9..65af241 100644 --- a/test/Index/complete-exprs.c +++ b/test/Index/complete-exprs.c @@ -7,9 +7,12 @@ int test(int i, int j, int k, int l) { return i | j | k & l; } -// RUN: c-index-test -code-completion-at=%s:7:9 %s | FileCheck -check-prefix=CHECK-CC1 %s -// CHECK-CC1: FunctionDecl:{ResultType int}{TypedText f}{LeftParen (}{Placeholder int}{RightParen )} -// CHECK-CC1: NotImplemented:{TypedText sizeof}{LeftParen (}{Placeholder expression-or-type}{RightParen )} -// RUN: c-index-test -code-completion-at=%s:7:14 %s | FileCheck -check-prefix=CHECK-CC1 %s -// RUN: c-index-test -code-completion-at=%s:7:18 %s | FileCheck -check-prefix=CHECK-CC1 %s -// RUN: c-index-test -code-completion-at=%s:7:22 %s | FileCheck -check-prefix=CHECK-CC1 %s +// RUN: c-index-test -code-completion-at=%s:7:9 -Xclang -code-completion-patterns %s | FileCheck -check-prefix=CHECK-CC1 %s +// CHECK-CC1: macro definition:{TypedText __VERSION__} (70) +// CHECK-CC1: FunctionDecl:{ResultType int}{TypedText f}{LeftParen (}{Placeholder int}{RightParen )} (50) +// CHECK-CC1: NotImplemented:{TypedText float} (40) +// CHECK-CC1: ParmDecl:{ResultType int}{TypedText j} (8) +// CHECK-CC1: NotImplemented:{TypedText sizeof}{LeftParen (}{Placeholder expression-or-type}{RightParen )} (30) +// RUN: c-index-test -code-completion-at=%s:7:14 -Xclang -code-completion-patterns %s | FileCheck -check-prefix=CHECK-CC1 %s +// RUN: c-index-test -code-completion-at=%s:7:18 -Xclang -code-completion-patterns %s | FileCheck -check-prefix=CHECK-CC1 %s +// RUN: c-index-test -code-completion-at=%s:7:22 -Xclang -code-completion-patterns %s | FileCheck -check-prefix=CHECK-CC1 %s diff --git a/test/Index/complete-member-access.m b/test/Index/complete-member-access.m index 2502d77..82efb95 100644 --- a/test/Index/complete-member-access.m +++ b/test/Index/complete-member-access.m @@ -26,5 +26,5 @@ void test_props(Int* ptr) { // CHECK-CC1: ObjCPropertyDecl:{ResultType int}{TypedText prop1} // CHECK-CC1: ObjCPropertyDecl:{ResultType float}{TypedText ProtoProp} // RUN: c-index-test -code-completion-at=%s:22:8 %s | FileCheck -check-prefix=CHECK-CC2 %s -// CHECK-CC2: ObjCIvarDecl:{ResultType int}{TypedText IVar} -// CHECK-CC2: ObjCIvarDecl:{ResultType int}{TypedText SuperIVar} +// CHECK-CC2: ObjCIvarDecl:{ResultType int}{TypedText IVar} (20) +// CHECK-CC2: ObjCIvarDecl:{ResultType int}{TypedText SuperIVar} (22) diff --git a/test/Index/complete-recovery.m b/test/Index/complete-recovery.m new file mode 100644 index 0000000..c28438d --- /dev/null +++ b/test/Index/complete-recovery.m @@ -0,0 +1,21 @@ +/* Run lines are at the end, since line/column matter in this test. */ + +@interface A +- (void)method:(int)x; +@end + +@implementation A +- (void)method:(int)x { + A *a = [A method:1]; + blarg * blah = wibble +} +@end + +// RUN: c-index-test -code-completion-at=%s:9:20 -Xclang -code-completion-patterns %s 2>%t | FileCheck -check-prefix=CHECK-CC1 %s +// RUN: not grep error %t +// CHECK-CC1: NotImplemented:{TypedText @encode}{LeftParen (}{Placeholder type-name}{RightParen )} +// CHECK-CC1: NotImplemented:{TypedText _Bool} +// CHECK-CC1: VarDecl:{ResultType A *}{TypedText a} +// CHECK-CC1: NotImplemented:{TypedText sizeof}{LeftParen (}{Placeholder expression-or-type}{RightParen )} + +// RUN: c-index-test -code-completion-at=%s:10:24 -Xclang -code-completion-patterns %s 2>%t | FileCheck -check-prefix=CHECK-CC1 %s diff --git a/test/Index/load-stmts.cpp b/test/Index/load-stmts.cpp index fdfedfb..cb99aee 100644 --- a/test/Index/load-stmts.cpp +++ b/test/Index/load-stmts.cpp @@ -11,8 +11,15 @@ void f(int x) { } // RUN: c-index-test -test-load-source all %s | FileCheck %s -// CHECK: load-stmts.cpp:3:6: UnexposedStmt= Extent=[4:3 - 5:4] -// CHECK: load-stmts.cpp:3:6: UnexposedStmt= Extent=[4:8 - 4:16] +// CHECK: load-stmts.cpp:1:13: TypedefDecl=T:1:13 (Definition) Extent=[1:13 - 1:14] +// CHECK: load-stmts.cpp:2:8: StructDecl=X:2:8 (Definition) Extent=[2:1 - 2:23] +// CHECK: load-stmts.cpp:2:16: FieldDecl=a:2:16 (Definition) Extent=[2:16 - 2:17] +// CHECK: load-stmts.cpp:2:19: FieldDecl=b:2:19 (Definition) Extent=[2:19 - 2:20] +// CHECK: load-stmts.cpp:3:6: FunctionDecl=f:3:6 (Definition) Extent=[3:6 - 11:2] +// CHECK: load-stmts.cpp:3:12: ParmDecl=x:3:12 (Definition) Extent=[3:8 - 3:13] +// CHECK: <invalid loc>:0:0: UnexposedStmt= Extent=[3:15 - 11:2] +// CHECK: <invalid loc>:0:0: UnexposedStmt= Extent=[4:3 - 5:4] +// CHECK: <invalid loc>:0:0: UnexposedStmt= Extent=[4:8 - 4:16] // CHECK: load-stmts.cpp:4:10: VarDecl=y:4:10 (Definition) Extent=[4:8 - 4:15] // CHECK: load-stmts.cpp:4:8: TypeRef=T:1:13 Extent=[4:8 - 4:9] // CHECK: load-stmts.cpp:4:14: DeclRefExpr=x:3:12 Extent=[4:14 - 4:15] @@ -23,29 +30,30 @@ void f(int x) { // CHECK: load-stmts.cpp:4:19: DeclRefExpr=z:4:19 Extent=[4:19 - 4:20] // CHECK: load-stmts.cpp:4:26: UnexposedExpr= Extent=[4:26 - 4:29] // CHECK: load-stmts.cpp:4:28: DeclRefExpr=x:3:12 Extent=[4:28 - 4:29] -// CHECK: load-stmts.cpp:4:19: UnexposedStmt= Extent=[4:31 - 5:4] -// CHECK: load-stmts.cpp:4:19: UnexposedStmt= Extent=[6:3 - 6:22] +// CHECK: <invalid loc>:0:0: UnexposedStmt= Extent=[4:31 - 5:4] +// CHECK: <invalid loc>:0:0: UnexposedStmt= Extent=[6:3 - 6:22] // CHECK: load-stmts.cpp:6:10: VarDecl=z2:6:10 (Definition) Extent=[6:7 - 6:17] // CHECK: load-stmts.cpp:6:7: TypeRef=T:1:13 Extent=[6:7 - 6:8] // CHECK: load-stmts.cpp:6:15: UnexposedExpr= Extent=[6:15 - 6:17] // CHECK: load-stmts.cpp:6:16: DeclRefExpr=x:3:12 Extent=[6:16 - 6:17] // CHECK: load-stmts.cpp:6:10: UnexposedExpr=z2:6:10 Extent=[6:10 - 6:12] // CHECK: load-stmts.cpp:6:10: DeclRefExpr=z2:6:10 Extent=[6:10 - 6:12] -// CHECK: load-stmts.cpp:6:10: UnexposedStmt= Extent=[6:19 - 6:22] -// CHECK: load-stmts.cpp:6:10: UnexposedStmt= Extent=[7:3 - 7:25] +// CHECK: <invalid loc>:0:0: UnexposedStmt= Extent=[6:19 - 6:22] +// CHECK: <invalid loc>:0:0: UnexposedStmt= Extent=[7:3 - 7:25] // CHECK: load-stmts.cpp:7:13: VarDecl=z3:7:13 (Definition) Extent=[7:10 - 7:20] // CHECK: load-stmts.cpp:7:10: TypeRef=T:1:13 Extent=[7:10 - 7:11] // CHECK: load-stmts.cpp:7:18: UnexposedExpr= Extent=[7:18 - 7:20] // CHECK: load-stmts.cpp:7:19: DeclRefExpr=x:3:12 Extent=[7:19 - 7:20] // CHECK: load-stmts.cpp:7:13: UnexposedExpr=z3:7:13 Extent=[7:13 - 7:15] // CHECK: load-stmts.cpp:7:13: DeclRefExpr=z3:7:13 Extent=[7:13 - 7:15] -// CHECK: load-stmts.cpp:7:13: UnexposedStmt= Extent=[7:22 - 7:25] -// CHECK: load-stmts.cpp:7:13: UnexposedStmt= Extent=[8:3 - 10:4] +// CHECK: <invalid loc>:0:0: UnexposedStmt= Extent=[7:22 - 7:25] +// CHECK: <invalid loc>:0:0: UnexposedStmt= Extent=[8:3 - 10:4] // CHECK: load-stmts.cpp:8:13: VarDecl=z4:8:13 (Definition) Extent=[8:11 - 8:19] // CHECK: load-stmts.cpp:8:11: TypeRef=T:1:13 Extent=[8:11 - 8:12] // CHECK: load-stmts.cpp:8:18: DeclRefExpr=x:3:12 Extent=[8:18 - 8:19] // CHECK: load-stmts.cpp:8:13: DeclRefExpr=z4:8:13 Extent=[8:13 - 8:15] -// CHECK: load-stmts.cpp:8:13: UnexposedStmt= Extent=[8:21 - 10:4] -// CHECK: load-stmts.cpp:8:13: UnexposedStmt= Extent=[9:3 - 9:17] -// CHECK: load-stmts.cpp:8:13: UnexposedStmt= Extent=[9:12 - 9:17] +// CHECK: <invalid loc>:0:0: UnexposedStmt= Extent=[8:21 - 10:4] +// CHECK: <invalid loc>:0:0: UnexposedStmt= Extent=[9:3 - 9:17] // CHECK: load-stmts.cpp:9:8: UnexposedExpr= Extent=[9:8 - 9:10] +// CHECK: <invalid loc>:0:0: UnexposedStmt= Extent=[9:12 - 9:17] + diff --git a/test/Index/print-typekind.c b/test/Index/print-typekind.c new file mode 100644 index 0000000..79a9965 --- /dev/null +++ b/test/Index/print-typekind.c @@ -0,0 +1,20 @@ +typedef int FooType; +int *p; +int *f(int *p, char *x, FooType z) { + FooType w = z; + return p + z; +} + +// RUN: c-index-test -test-print-typekind %s | FileCheck %s +// CHECK: TypedefDecl=FooType:1:13 (Definition) typekind=Typedef [canonical=Int] +// CHECK: VarDecl=p:2:6 typekind=Pointer +// CHECK: FunctionDecl=f:3:6 (Definition) typekind=Unexposed [canonical=Unexposed] +// CHECK: ParmDecl=p:3:13 (Definition) typekind=Pointer +// CHECK: ParmDecl=x:3:22 (Definition) typekind=Pointer +// CHECK: ParmDecl=z:3:33 (Definition) typekind=Typedef [canonical=Int] +// CHECK: VarDecl=w:4:11 (Definition) typekind=Typedef [canonical=Int] +// CHECK: DeclRefExpr=z:3:33 typekind=Typedef [canonical=Int] +// CHECK: UnexposedExpr= typekind=Pointer +// CHECK: DeclRefExpr=p:3:13 typekind=Pointer +// CHECK: DeclRefExpr=z:3:33 typekind=Typedef [canonical=Int] + diff --git a/test/Index/properties-class-extensions.m b/test/Index/properties-class-extensions.m new file mode 100644 index 0000000..8bca37e --- /dev/null +++ b/test/Index/properties-class-extensions.m @@ -0,0 +1,28 @@ +// Test that @properties within class extensions are visited by +// clang_visitChildren only in the class extension, not the original +// @interface (where we have a duplicate declaration - to be removed). +@interface Foo {} @end +@interface Foo (Cat) + @property int a; +@end +@interface Foo () + @property int b; + - (void) bar; +@end + +// RUN: c-index-test -test-load-source local %s | FileCheck %s +// CHECK: properties-class-extensions.m:4:12: ObjCInterfaceDecl=Foo:4:12 Extent=[4:1 - 4:23] +// CHECK: properties-class-extensions.m:5:12: ObjCCategoryDecl=Cat:5:12 Extent=[5:1 - 7:5] +// CHECK: properties-class-extensions.m:5:12: ObjCClassRef=Foo:4:12 Extent=[5:12 - 5:15] +// CHECK: properties-class-extensions.m:6:17: ObjCPropertyDecl=a:6:17 Extent=[6:17 - 6:18] +// CHECK: properties-class-extensions.m:6:17: ObjCInstanceMethodDecl=a:6:17 Extent=[6:17 - 6:18] +// CHECK: properties-class-extensions.m:6:17: ObjCInstanceMethodDecl=setA::6:17 Extent=[6:17 - 6:18] +// CHECK: properties-class-extensions.m:6:17: ParmDecl=a:6:17 (Definition) Extent=[6:17 - 6:18] +// CHECK: properties-class-extensions.m:8:12: ObjCCategoryDecl=:8:12 Extent=[8:1 - 11:5] +// CHECK: properties-class-extensions.m:8:12: ObjCClassRef=Foo:4:12 Extent=[8:12 - 8:15] +// CHECK: properties-class-extensions.m:9:17: ObjCPropertyDecl=b:9:17 Extent=[9:17 - 9:18] +// CHECK: properties-class-extensions.m:9:17: ObjCInstanceMethodDecl=b:9:17 Extent=[9:17 - 9:18] +// CHECK: properties-class-extensions.m:9:17: ObjCInstanceMethodDecl=setB::9:17 Extent=[9:17 - 9:18] +// CHECK: properties-class-extensions.m:9:17: ParmDecl=b:9:17 (Definition) Extent=[9:17 - 9:18] +// CHECK: properties-class-extensions.m:10:3: ObjCInstanceMethodDecl=bar:10:3 Extent=[10:3 - 10:16] + diff --git a/test/Index/remap-load.c b/test/Index/remap-load.c index b8415e6..d9634a4 100644 --- a/test/Index/remap-load.c +++ b/test/Index/remap-load.c @@ -5,8 +5,8 @@ // CHECK: remap-load.c:1:5: FunctionDecl=foo:1:5 (Definition) Extent=[1:5 - 3:2] // CHECK: remap-load.c:1:13: ParmDecl=parm1:1:13 (Definition) Extent=[1:9 - 1:18] // CHECK: remap-load.c:1:26: ParmDecl=parm2:1:26 (Definition) Extent=[1:20 - 1:31] -// CHECK: remap-load.c:1:5: UnexposedStmt= Extent=[1:33 - 3:2] -// CHECK: remap-load.c:1:5: UnexposedStmt= Extent=[2:3 - 2:23] +// CHECK: <invalid loc>:0:0: UnexposedStmt= Extent=[1:33 - 3:2] +// CHECK: <invalid loc>:0:0: UnexposedStmt= Extent=[2:3 - 2:23] // CHECK: remap-load.c:2:10: UnexposedExpr= Extent=[2:10 - 2:23] // CHECK: remap-load.c:2:10: UnexposedExpr= Extent=[2:10 - 2:23] // CHECK: remap-load.c:2:10: UnexposedExpr=parm1:1:13 Extent=[2:10 - 2:15] diff --git a/test/Index/usrs.cpp b/test/Index/usrs.cpp new file mode 100644 index 0000000..b6a6d3d --- /dev/null +++ b/test/Index/usrs.cpp @@ -0,0 +1,107 @@ +namespace foo { + int x; + void bar(int z); +} +namespace bar { + typedef int QType; + void bar(QType z); +} + +class ClsA { +public: + int a, b; + ClsA(int A, int B) : a(A), b(B) {} +}; + +namespace foo { + class ClsB : public ClsA { + public: + ClsB() : ClsA(1, 2) {} + int result() const; + }; +} + +int foo::ClsB::result() const { + return a + b; +} + +namespace { + class ClsC : public foo::ClsB {}; + int w; +} + +int z; + +namespace foo { namespace taz { + int x; + static inline int add(int a, int b) { return a + b; } + void sub(int a, int b); +} +} + +namespace foo { namespace taz { + class ClsD : public foo::ClsB { + public: + ClsD& operator=(int x) { a = x; return *this; } + ClsD& operator=(double x) { a = (int) x; return *this; } + ClsD& operator=(const ClsD &x) { a = x.a; return *this; } + static int qux(); + static int uz(int z, ...); + bool operator==(const ClsD &x) const { return a == x.a; } + }; +}} + +extern "C" { + void rez(int a, int b); +} + +// RUN: c-index-test -test-load-source-usrs all %s | FileCheck %s +// CHECK: usrs.cpp c:@N@foo Extent=[1:11 - 4:2] +// CHECK: usrs.cpp c:@N@foo@x Extent=[2:3 - 2:8] +// CHECK: usrs.cpp c:@N@foo@F@bar#I# Extent=[3:8 - 3:18] +// CHECK: usrs.cpp c:usrs.cpp@3:12@N@foo@F@bar#I#@z Extent=[3:12 - 3:17] +// CHECK: usrs.cpp c:@N@bar Extent=[5:11 - 8:2] +// CHECK: usrs.cpp c:usrs.cpp@6:15@N@bar@T@QType Extent=[6:15 - 6:20] +// CHECK: usrs.cpp c:@N@bar@F@bar#I# Extent=[7:8 - 7:20] +// CHECK: usrs.cpp c:usrs.cpp@7:12@N@bar@F@bar#I#@z Extent=[7:12 - 7:19] +// CHECK: usrs.cpp c:@C@ClsA Extent=[10:1 - 14:2] +// CHECK: usrs.cpp c:@C@ClsA@FI@a Extent=[12:7 - 12:8] +// CHECK: usrs.cpp c:@C@ClsA@FI@b Extent=[12:10 - 12:11] +// CHECK: usrs.cpp c:@C@ClsA@F@ClsA#I#I# Extent=[13:3 - 13:37] +// CHECK: usrs.cpp c:usrs.cpp@13:8@C@ClsA@F@ClsA#I#I#@A Extent=[13:8 - 13:13] +// CHECK: usrs.cpp c:usrs.cpp@13:15@C@ClsA@F@ClsA#I#I#@B Extent=[13:15 - 13:20] +// CHECK: usrs.cpp c:@N@foo Extent=[16:11 - 22:2] +// CHECK: usrs.cpp c:@N@foo@C@ClsB Extent=[17:3 - 21:4] +// CHECK: usrs.cpp c:@N@foo@C@ClsB@F@ClsB# Extent=[19:5 - 19:27] +// CHECK: usrs.cpp c:@N@foo@C@ClsB@F@result#1 Extent=[20:9 - 20:17] +// CHECK: usrs.cpp c:@N@foo@C@ClsB@F@result#1 Extent=[24:16 - 26:2] +// CHECK: usrs.cpp c:@aN@C@ClsC Extent=[29:3 - 29:35] +// CHECK: usrs.cpp c:@aN@w Extent=[30:3 - 30:8] +// CHECK: usrs.cpp c:@z Extent=[33:1 - 33:6] +// CHECK: usrs.cpp c:@N@foo Extent=[35:11 - 40:2] +// CHECK: usrs.cpp c:@N@foo@N@taz Extent=[35:27 - 39:2] +// CHECK: usrs.cpp c:@N@foo@N@taz@x Extent=[36:3 - 36:8] +// CHECK: usrs.cpp c:usrs.cpp@37:21@N@foo@N@taz@F@add#I#I# Extent=[37:21 - 37:56] +// CHECK: usrs.cpp c:usrs.cpp@37:25@N@foo@N@taz@F@add#I#I#@a Extent=[37:25 - 37:30] +// CHECK: usrs.cpp c:usrs.cpp@37:32@N@foo@N@taz@F@add#I#I#@b Extent=[37:32 - 37:37] +// CHECK: usrs.cpp c:@N@foo@N@taz@F@sub#I#I# Extent=[38:8 - 38:25] +// CHECK: usrs.cpp c:usrs.cpp@38:12@N@foo@N@taz@F@sub#I#I#@a Extent=[38:12 - 38:17] +// CHECK: usrs.cpp c:usrs.cpp@38:19@N@foo@N@taz@F@sub#I#I#@b Extent=[38:19 - 38:24] +// CHECK: usrs.cpp c:@N@foo Extent=[42:11 - 52:3] +// CHECK: usrs.cpp c:@N@foo@N@taz Extent=[42:27 - 52:2] +// CHECK: usrs.cpp c:@N@foo@N@taz@C@ClsD Extent=[43:3 - 51:4] +// CHECK: usrs.cpp c:@N@foo@N@taz@C@ClsD@F@operator=#I# Extent=[45:11 - 45:52] +// CHECK: usrs.cpp c:usrs.cpp@45:21@N@foo@N@taz@C@ClsD@F@operator=#I#@x Extent=[45:21 - 45:26] +// CHECK: usrs.cpp c:@N@foo@N@taz@C@ClsD@F@operator=#d# Extent=[46:11 - 46:61] +// CHECK: usrs.cpp c:usrs.cpp@46:21@N@foo@N@taz@C@ClsD@F@operator=#d#@x Extent=[46:21 - 46:29] +// CHECK: usrs.cpp c:@N@foo@N@taz@C@ClsD@F@operator=#&1$@N@foo@N@taz@C@ClsD# Extent=[47:11 - 47:62] +// CHECK: usrs.cpp c:usrs.cpp@47:27@N@foo@N@taz@C@ClsD@F@operator=#&1$@N@foo@N@taz@C@ClsD#@x Extent=[47:27 - 47:34] +// CHECK: usrs.cpp c:@N@foo@N@taz@C@ClsD@F@qux#S Extent=[48:16 - 48:21] +// CHECK: usrs.cpp c:@N@foo@N@taz@C@ClsD@F@uz#I.#S Extent=[49:16 - 49:30] +// CHECK: usrs.cpp c:usrs.cpp@49:19@N@foo@N@taz@C@ClsD@F@uz#I.#S@z Extent=[49:19 - 49:24] +// CHECK: usrs.cpp c:@N@foo@N@taz@C@ClsD@F@operator==#&1$@N@foo@N@taz@C@ClsD#1 Extent=[50:10 - 50:62] +// CHECK: usrs.cpp c:usrs.cpp@50:27@N@foo@N@taz@C@ClsD@F@operator==#&1$@N@foo@N@taz@C@ClsD#1@x Extent=[50:27 - 50:34] +// CHECK: usrs.cpp c:@F@rez Extent=[55:8 - 55:25] +// CHECK: usrs.cpp c:usrs.cpp@55:12@F@rez@a Extent=[55:12 - 55:17] +// CHECK: usrs.cpp c:usrs.cpp@55:19@F@rez@b Extent=[55:19 - 55:24] + diff --git a/test/Index/usrs.m b/test/Index/usrs.m index eb0817c..bffd0ee 100644 --- a/test/Index/usrs.m +++ b/test/Index/usrs.m @@ -49,18 +49,18 @@ int z; static int local_func(int x) { return x; } // CHECK: usrs.m c:usrs.m@3:19@F@my_helper Extent=[3:19 - 3:60] -// CHECK: usrs.m c:usrs.m@3:29@x Extent=[3:29 - 3:34] -// CHECK: usrs.m c:usrs.m@3:36@y Extent=[3:36 - 3:41] -// CHECK: usrs.m c:@Ea@usrs.m@5:1 Extent=[5:1 - 8:2] -// CHECK: usrs.m c:@Ea@usrs.m@5:1@ABA Extent=[6:3 - 6:6] -// CHECK: usrs.m c:@Ea@usrs.m@5:1@CADABA Extent=[7:3 - 7:9] -// CHECK: usrs.m c:@Ea@usrs.m@10:1 Extent=[10:1 - 13:2] -// CHECK: usrs.m c:@Ea@usrs.m@10:1@FOO Extent=[11:3 - 11:6] -// CHECK: usrs.m c:@Ea@usrs.m@10:1@BAR Extent=[12:3 - 12:6] +// CHECK: usrs.m c:usrs.m@3:29@F@my_helper@x Extent=[3:29 - 3:34] +// CHECK: usrs.m c:usrs.m@3:36@F@my_helper@y Extent=[3:36 - 3:41] +// CHECK: usrs.m c:usrs.m@5:1@Ea Extent=[5:1 - 8:2] +// CHECK: usrs.m c:usrs.m@5:1@Ea@ABA Extent=[6:3 - 6:6] +// CHECK: usrs.m c:usrs.m@5:1@Ea@CADABA Extent=[7:3 - 7:9] +// CHECK: usrs.m c:usrs.m@10:1@Ea Extent=[10:1 - 13:2] +// CHECK: usrs.m c:usrs.m@10:1@Ea@FOO Extent=[11:3 - 11:6] +// CHECK: usrs.m c:usrs.m@10:1@Ea@BAR Extent=[12:3 - 12:6] // CHECK: usrs.m c:@SA@MyStruct Extent=[15:9 - 18:2] // CHECK: usrs.m c:@SA@MyStruct@FI@wa Extent=[16:7 - 16:9] // CHECK: usrs.m c:@SA@MyStruct@FI@moo Extent=[17:7 - 17:10] -// CHECK: usrs.m c:@T@usrs.m@18:3@MyStruct Extent=[18:3 - 18:11] +// CHECK: usrs.m c:usrs.m@18:3@T@MyStruct Extent=[18:3 - 18:11] // CHECK: usrs.m c:@E@Pizza Extent=[20:1 - 23:2] // CHECK: usrs.m c:@E@Pizza@CHEESE Extent=[21:3 - 21:9] // CHECK: usrs.m c:@E@Pizza@MUSHROOMS Extent=[22:3 - 22:12] @@ -72,16 +72,16 @@ static int local_func(int x) { return x; } // CHECK: usrs.m c:objc(cs)Foo(cm)kingkong Extent=[30:1 - 30:17] // CHECK: usrs.m c:objc(cs)Foo(im)d1 Extent=[31:15 - 31:17] // CHECK: usrs.m c:objc(cs)Foo(im)setD1: Extent=[31:15 - 31:17] -// CHECK: usrs.m c:usrs.m@31:15@d1 Extent=[31:15 - 31:17] +// CHECK: usrs.m c:usrs.m@31:15objc(cs)Foo(im)setD1:@d1 Extent=[31:15 - 31:17] // CHECK: usrs.m c:objc(cs)Foo Extent=[34:1 - 45:2] // CHECK: usrs.m c:objc(cs)Foo(im)godzilla Extent=[35:1 - 39:2] -// CHECK: usrs.m c:usrs.m@36:10@a Extent=[36:10 - 36:19] -// CHECK: usrs.m c:@z Extent=[37:10 - 37:15] +// CHECK: usrs.m c:usrs.m@36:10objc(cs)Foo(im)godzilla@a Extent=[36:10 - 36:19] +// CHECK: usrs.m c:objc(cs)Foo(im)godzilla@z Extent=[37:10 - 37:15] // CHECK: usrs.m c:objc(cs)Foo(cm)kingkong Extent=[40:1 - 43:2] -// CHECK: usrs.m c:usrs.m@41:3@local_var Extent=[41:3 - 41:16] +// CHECK: usrs.m c:usrs.m@41:3objc(cs)Foo(cm)kingkong@local_var Extent=[41:3 - 41:16] // CHECK: usrs.m c:objc(cs)Foo@d1 Extent=[44:13 - 44:15] // CHECK: usrs.m c:objc(cs)Foo(py)d1 Extent=[44:1 - 44:15] // CHECK: usrs.m c:@z Extent=[47:1 - 47:6] // CHECK: usrs.m c:usrs.m@49:12@F@local_func Extent=[49:12 - 49:43] -// CHECK: usrs.m c:usrs.m@49:23@x Extent=[49:23 - 49:28] +// CHECK: usrs.m c:usrs.m@49:23@F@local_func@x Extent=[49:23 - 49:28] |