diff options
Diffstat (limited to 'test/Index')
-rw-r--r-- | test/Index/Inputs/guarded.h | 6 | ||||
-rw-r--r-- | test/Index/Inputs/pragma-once.h | 3 | ||||
-rw-r--r-- | test/Index/annotate-context-sensitive.cpp | 12 | ||||
-rw-r--r-- | test/Index/annotate-tokens-pp.c | 8 | ||||
-rw-r--r-- | test/Index/annotate-tokens.m | 8 | ||||
-rw-r--r-- | test/Index/complete-kvc.m | 20 | ||||
-rw-r--r-- | test/Index/complete-member-access.m | 17 | ||||
-rw-r--r-- | test/Index/complete-property-flags.m | 1 | ||||
-rw-r--r-- | test/Index/nested-macro-instantiations.cpp | 20 | ||||
-rw-r--r-- | test/Index/overrides.cpp | 4 | ||||
-rw-r--r-- | test/Index/properties-class-extensions.m | 2 | ||||
-rw-r--r-- | test/Index/recursive-cxx-member-calls.cpp | 34 | ||||
-rw-r--r-- | test/Index/usrs.cpp | 22 | ||||
-rw-r--r-- | test/Index/usrs.m | 2 |
14 files changed, 125 insertions, 34 deletions
diff --git a/test/Index/Inputs/guarded.h b/test/Index/Inputs/guarded.h new file mode 100644 index 0000000..0a1a6ac --- /dev/null +++ b/test/Index/Inputs/guarded.h @@ -0,0 +1,6 @@ +#ifndef GUARDED_HEADER_H +#define GUARDED_HEADER_H + +int y; + +#endif // GUARDED_HEADER_H diff --git a/test/Index/Inputs/pragma-once.h b/test/Index/Inputs/pragma-once.h new file mode 100644 index 0000000..503cb3f --- /dev/null +++ b/test/Index/Inputs/pragma-once.h @@ -0,0 +1,3 @@ +#pragma once +int i; + diff --git a/test/Index/annotate-context-sensitive.cpp b/test/Index/annotate-context-sensitive.cpp index 307bced..151914c 100644 --- a/test/Index/annotate-context-sensitive.cpp +++ b/test/Index/annotate-context-sensitive.cpp @@ -28,12 +28,12 @@ struct Derived2 : Base2 { // CHECK-OVERRIDE-FINAL: Identifier: "Base" [6:30 - 6:34] TypeRef=class Base:1:7 // CHECK-OVERRIDE-FINAL: Punctuation: "{" [6:35 - 6:36] ClassDecl=Derived:6:7 (Definition) // CHECK-OVERRIDE-FINAL: Keyword: "virtual" [7:3 - 7:10] ClassDecl=Derived:6:7 (Definition) -// CHECK-OVERRIDE-FINAL: Keyword: "void" [7:11 - 7:15] CXXMethod=f:7:16 [Overrides @3:16] -// CHECK-OVERRIDE-FINAL: Identifier: "f" [7:16 - 7:17] CXXMethod=f:7:16 [Overrides @3:16] -// CHECK-OVERRIDE-FINAL: Punctuation: "(" [7:17 - 7:18] CXXMethod=f:7:16 [Overrides @3:16] -// CHECK-OVERRIDE-FINAL: Punctuation: ")" [7:18 - 7:19] CXXMethod=f:7:16 [Overrides @3:16] -// CHECK-OVERRIDE-FINAL: Keyword: "override" [7:20 - 7:28] CXXMethod=f:7:16 [Overrides @3:16] -// CHECK-OVERRIDE-FINAL: Keyword: "final" [7:29 - 7:34] CXXMethod=f:7:16 [Overrides @3:16] +// CHECK-OVERRIDE-FINAL: Keyword: "void" [7:11 - 7:15] CXXMethod=f:7:16 (virtual) [Overrides @3:16] +// CHECK-OVERRIDE-FINAL: Identifier: "f" [7:16 - 7:17] CXXMethod=f:7:16 (virtual) [Overrides @3:16] +// CHECK-OVERRIDE-FINAL: Punctuation: "(" [7:17 - 7:18] CXXMethod=f:7:16 (virtual) [Overrides @3:16] +// CHECK-OVERRIDE-FINAL: Punctuation: ")" [7:18 - 7:19] CXXMethod=f:7:16 (virtual) [Overrides @3:16] +// CHECK-OVERRIDE-FINAL: Keyword: "override" [7:20 - 7:28] CXXMethod=f:7:16 (virtual) [Overrides @3:16] +// CHECK-OVERRIDE-FINAL: Keyword: "final" [7:29 - 7:34] CXXMethod=f:7:16 (virtual) [Overrides @3:16] // CHECK-OVERRIDE-FINAL: Punctuation: ";" [7:34 - 7:35] ClassDecl=Derived:6:7 (Definition) // CHECK-OVERRIDE-FINAL: Keyword: "struct" [9:3 - 9:9] StructDecl=final:9:10 (Definition) // CHECK-OVERRIDE-FINAL: Identifier: "final" [9:10 - 9:15] StructDecl=final:9:10 (Definition) diff --git a/test/Index/annotate-tokens-pp.c b/test/Index/annotate-tokens-pp.c index 3dd9ffe..01a615f 100644 --- a/test/Index/annotate-tokens-pp.c +++ b/test/Index/annotate-tokens-pp.c @@ -25,7 +25,10 @@ void test() { fun_with_macro_bodies(x, { int z = x; ++z; }); } -// RUN: c-index-test -test-annotate-tokens=%s:2:1:26:1 -I%S/Inputs %s | FileCheck %s +#include "pragma-once.h" +#include "guarded.h" + +// RUN: c-index-test -test-annotate-tokens=%s:2:1:30:1 -I%S/Inputs %s | FileCheck %s // CHECK: Punctuation: "#" [2:1 - 2:2] preprocessing directive= // CHECK: Identifier: "define" [2:2 - 2:8] preprocessing directive= // CHECK: Identifier: "STILL_NOTHING" [2:9 - 2:22] macro definition=STILL_NOTHING @@ -184,4 +187,5 @@ void test() { // CHECK: Punctuation: ")" [25:47 - 25:48] UnexposedStmt= // CHECK: Punctuation: ";" [25:48 - 25:49] UnexposedStmt= // CHECK: Punctuation: "}" [26:1 - 26:2] UnexposedStmt= - +// CHECK: {{28:1.*inclusion directive=pragma-once.h.*multi-include guarded}} +// CHECK: {{29:1.*inclusion directive=guarded.h.*multi-include guarded}} diff --git a/test/Index/annotate-tokens.m b/test/Index/annotate-tokens.m index f977e5c..1eb7794 100644 --- a/test/Index/annotate-tokens.m +++ b/test/Index/annotate-tokens.m @@ -500,10 +500,10 @@ static Rdar8595462_A * Rdar8595462_staticVar; // CHECK: Punctuation: "*" [111:26 - 111:27] ObjCPropertyDecl=foo2:111:27 // CHECK: Identifier: "foo2" [111:27 - 111:31] ObjCPropertyDecl=foo2:111:27 -// CHECK: Punctuation: "@" [115:1 - 115:2] UnexposedDecl=foo:110:33 (Definition) -// CHECK: Keyword: "synthesize" [115:2 - 115:12] UnexposedDecl=foo:110:33 (Definition) -// CHECK: Identifier: "foo" [115:13 - 115:16] UnexposedDecl=foo:110:33 (Definition) -// CHECK: Punctuation: "=" [115:17 - 115:18] UnexposedDecl=foo:110:33 (Definition) +// CHECK: Punctuation: "@" [115:1 - 115:2] ObjCSynthesizeDecl=foo:110:33 (Definition) +// CHECK: Keyword: "synthesize" [115:2 - 115:12] ObjCSynthesizeDecl=foo:110:33 (Definition) +// CHECK: Identifier: "foo" [115:13 - 115:16] ObjCSynthesizeDecl=foo:110:33 (Definition) +// CHECK: Punctuation: "=" [115:17 - 115:18] ObjCSynthesizeDecl=foo:110:33 (Definition) // CHECK: Identifier: "_foo" [115:19 - 115:23] MemberRef=_foo:107:8 // CHECK: Punctuation: ";" [115:23 - 115:24] ObjCImplementationDecl=Rdar8595386:114:1 (Definition) diff --git a/test/Index/complete-kvc.m b/test/Index/complete-kvc.m index 43a874b..62d98a9 100644 --- a/test/Index/complete-kvc.m +++ b/test/Index/complete-kvc.m @@ -41,6 +41,17 @@ typedef signed char BOOL; + (NSSet *)keyPathsForValuesAffectingIntProperty { return 0; } @end +@interface MySubClass : MyClass +@end + +@interface MySubClass () +@property int intProperty; +@end + +@implementation MySubClass +- (int)intProperty { return 0; } +@end + // RUN: c-index-test -code-completion-at=%s:39:3 %s | FileCheck -check-prefix=CHECK-CC1 %s // CHECK-CC1: ObjCInstanceMethodDecl:{LeftParen (}{Text void}{RightParen )}{TypedText addMutableArrayPropertyObject:}{LeftParen (}{Placeholder object-type}{Text *}{RightParen )}{Text object} (55) // CHECK-CC1: ObjCInstanceMethodDecl:{LeftParen (}{Text void}{RightParen )}{TypedText addMutableSetProperty:}{LeftParen (}{Text NSSet *}{RightParen )}{Text objects} (40) @@ -84,4 +95,11 @@ typedef signed char BOOL; // CHECK-CC1: ObjCInstanceMethodDecl:{LeftParen (}{Text void}{RightParen )}{TypedText replaceObjectInMySetPropertyAtIndex:}{LeftParen (}{Placeholder NSUInteger}{RightParen )}{Text index}{HorizontalSpace }{TypedText withObject:}{LeftParen (}{Text id}{RightParen )}{Text object} (55) // RUN: c-index-test -code-completion-at=%s:41:3 %s | FileCheck -check-prefix=CHECK-CC2 %s -// CHECK-CC2: ObjCInstanceMethodDecl:{LeftParen (}{Text NSSet *}{RightParen )}{TypedText keyPathsForValuesAffectingMutableArrayProperty} (40) +// CHECK-CC2: ObjCClassMethodDecl:{LeftParen (}{Text BOOL}{RightParen )}{TypedText automaticallyNotifiesObserversOfArrayProperty} (40) +// CHECK-CC2: ObjCClassMethodDecl:{LeftParen (}{Text BOOL}{RightParen )}{TypedText automaticallyNotifiesObserversOfMutableArrayProperty} (40) +// CHECK-CC2: ObjCClassMethodDecl:{LeftParen (}{Text NSSet *}{RightParen )}{TypedText keyPathsForValuesAffectingMutableArrayProperty} (40) + +// RUN: c-index-test -code-completion-at=%s:52:8 %s | FileCheck -check-prefix=CHECK-CC3 %s +// CHECK-CC3: ObjCInstanceMethodDecl:{TypedText countOfIntProperty} (55) +// CHECK-CC3-NEXT: ObjCInstanceMethodDecl:{TypedText intProperty} (40) +// CHECK-CC3-NEXT: ObjCInstanceMethodDecl:{TypedText isIntProperty} (40) diff --git a/test/Index/complete-member-access.m b/test/Index/complete-member-access.m index ad2998c..bd68deb 100644 --- a/test/Index/complete-member-access.m +++ b/test/Index/complete-member-access.m @@ -22,9 +22,26 @@ void test_props(Int* ptr) { ptr->IVar = 0; } +@interface Sub : Int +@property int myProp; + +- (int)myProp; +- (int)myOtherPropLikeThing; +- (int)myOtherNonPropThing:(int)value; +@end + +int test_more_props(Sub *s) { + return s.myOtherPropLikeThing; +} + // RUN: c-index-test -code-completion-at=%s:21:7 %s | FileCheck -check-prefix=CHECK-CC1 %s // 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} (35) // CHECK-CC2: ObjCIvarDecl:{ResultType int}{TypedText SuperIVar} (37) +// RUN: c-index-test -code-completion-at=%s:34:12 %s | FileCheck -check-prefix=CHECK-CC3 %s +// CHECK-CC3: ObjCInstanceMethodDecl:{ResultType int}{TypedText myOtherPropLikeThing} (37) +// CHECK-CC3: ObjCPropertyDecl:{ResultType int}{TypedText myProp} (35) +// CHECK-CC3: ObjCPropertyDecl:{ResultType int}{TypedText prop1} (35) +// CHECK-CC3: ObjCPropertyDecl:{ResultType float}{TypedText ProtoProp} (35) diff --git a/test/Index/complete-property-flags.m b/test/Index/complete-property-flags.m index cd3696f..af9e214 100644 --- a/test/Index/complete-property-flags.m +++ b/test/Index/complete-property-flags.m @@ -8,6 +8,7 @@ @property(retain, nonatomic) id xx; // RUN: c-index-test -code-completion-at=%s:7:11 %s | FileCheck -check-prefix=CHECK-CC1 %s // CHECK-CC1: {TypedText assign} +// CHECK-CC1-NEXT: {TypedText atomic} // CHECK-CC1-NEXT: {TypedText copy} // CHECK-CC1-NEXT: {TypedText getter}{Text = }{Placeholder method} // CHECK-CC1-NEXT: {TypedText nonatomic} diff --git a/test/Index/nested-macro-instantiations.cpp b/test/Index/nested-macro-instantiations.cpp new file mode 100644 index 0000000..d0c9bbb1 --- /dev/null +++ b/test/Index/nested-macro-instantiations.cpp @@ -0,0 +1,20 @@ +#define FOO(x) x +#define BAR(x) FOO(x) +#define WIBBLE(x) BAR(x) + +WIBBLE(int x); + +// RUN: env CINDEXTEST_NESTED_MACROS=1 c-index-test -test-load-source all %s | FileCheck -check-prefix CHECK-WITH-NESTED %s +// RUN: env CINDEXTEST_EDITING=1 CINDEXTEST_NESTED_MACROS=1 c-index-test -test-load-source all %s | FileCheck -check-prefix CHECK-WITH-NESTED %s +// RUN: env CINDEXTEST_EDITING=1 CINDEXTEST_NESTED_MACROS=1 c-index-test -test-load-source-reparse 5 all %s | FileCheck -check-prefix CHECK-WITH-NESTED %s +// CHECK-WITH-NESTED: nested-macro-instantiations.cpp:5:1: macro instantiation=WIBBLE:3:9 Extent=[5:1 - 5:7] +// CHECK-WITH-NESTED: nested-macro-instantiations.cpp:3:19: macro instantiation=BAR:2:9 Extent=[3:19 - 5:14] +// CHECK-WITH-NESTED: nested-macro-instantiations.cpp:2:16: macro instantiation=FOO:1:9 Extent=[2:16 - 5:14] +// CHECK-WITH-NESTED: nested-macro-instantiations.cpp:5:1: VarDecl=x:5:1 (Definition) Extent=[5:1 - 5:14] + +// RUN: c-index-test -test-load-source all %s | FileCheck -check-prefix CHECK-WITHOUT-NESTED %s +// RUN: env CINDEXTEST_EDITING=1 c-index-test -test-load-source all %s | FileCheck -check-prefix CHECK-WITHOUT-NESTED %s +// RUN: env CINDEXTEST_EDITING=1 c-index-test -test-load-source-reparse 5 all %s | FileCheck -check-prefix CHECK-WITHOUT-NESTED %s +// CHECK-WITHOUT-NESTED: nested-macro-instantiations.cpp:5:1: macro instantiation=WIBBLE:3:9 Extent=[5:1 - 5:7] +// CHECK-WITHOUT-NESTED-NOT: nested-macro-instantiations.cpp:3:19: macro instantiation=BAR:2:9 Extent=[3:19 - 5:14] +// CHECK-WITHOUT-NESTED: nested-macro-instantiations.cpp:5:1: VarDecl=x:5:1 (Definition) Extent=[5:1 - 5:14] diff --git a/test/Index/overrides.cpp b/test/Index/overrides.cpp index ed24cc5..698b256 100644 --- a/test/Index/overrides.cpp +++ b/test/Index/overrides.cpp @@ -16,5 +16,5 @@ struct D : C { }; // RUN: c-index-test -test-load-source local %s | FileCheck %s -// CHECK: overrides.cpp:11:16: CXXMethod=g:11:16 [Overrides @7:16] Extent=[11:3 - 11:19] -// CHECK: overrides.cpp:15:16: CXXMethod=f:15:16 [Overrides @2:16, @6:16] Extent=[15:3 - 15:22] +// CHECK: overrides.cpp:11:16: CXXMethod=g:11:16 (virtual) [Overrides @7:16] Extent=[11:3 - 11:19] +// CHECK: overrides.cpp:15:16: CXXMethod=f:15:16 (virtual) [Overrides @2:16, @6:16] Extent=[15:3 - 15:22] diff --git a/test/Index/properties-class-extensions.m b/test/Index/properties-class-extensions.m index ecedc60..de61242 100644 --- a/test/Index/properties-class-extensions.m +++ b/test/Index/properties-class-extensions.m @@ -95,5 +95,5 @@ // CHECK: properties-class-extensions.m:38:34: ObjCInstanceMethodDecl=qux:38:34 Extent=[38:34 - 38:37] // CHECK: properties-class-extensions.m:38:34: ObjCInstanceMethodDecl=setQux::38:34 Extent=[38:34 - 38:37] // CHECK: properties-class-extensions.m:38:34: ParmDecl=qux:38:34 (Definition) Extent=[38:34 - 38:37] -// CHECK: properties-class-extensions.m:42:10: UnexposedDecl=qux:38:34 (Definition) Extent=[42:1 - 42:13] +// CHECK: properties-class-extensions.m:42:10: ObjCDynamicDecl=qux:38:34 (Definition) Extent=[42:1 - 42:13] diff --git a/test/Index/recursive-cxx-member-calls.cpp b/test/Index/recursive-cxx-member-calls.cpp index 6170fdc..4c24083 100644 --- a/test/Index/recursive-cxx-member-calls.cpp +++ b/test/Index/recursive-cxx-member-calls.cpp @@ -399,13 +399,13 @@ AttributeList::Kind AttributeList::getKind(const IdentifierInfo * Name) { // CHECK-tokens: Punctuation: ";" [32:6 - 32:7] ClassDecl=AttributeList:12:9 (Definition) // CHECK-tokens: Keyword: "static" [33:5 - 33:11] ClassDecl=AttributeList:12:9 (Definition) // CHECK-tokens: Identifier: "Kind" [33:12 - 33:16] TypeRef=enum clang::AttributeList::Kind:13:10 -// CHECK-tokens: Identifier: "getKind" [33:17 - 33:24] CXXMethod=getKind:33:17 -// CHECK-tokens: Punctuation: "(" [33:24 - 33:25] CXXMethod=getKind:33:17 -// CHECK-tokens: Keyword: "const" [33:25 - 33:30] CXXMethod=getKind:33:17 +// CHECK-tokens: Identifier: "getKind" [33:17 - 33:24] CXXMethod=getKind:33:17 (static) +// CHECK-tokens: Punctuation: "(" [33:24 - 33:25] CXXMethod=getKind:33:17 (static) +// CHECK-tokens: Keyword: "const" [33:25 - 33:30] CXXMethod=getKind:33:17 (static) // CHECK-tokens: Identifier: "IdentifierInfo" [33:31 - 33:45] TypeRef=class clang::IdentifierInfo:66:7 // CHECK-tokens: Punctuation: "*" [33:46 - 33:47] ParmDecl=Name:33:48 (Definition) // CHECK-tokens: Identifier: "Name" [33:48 - 33:52] ParmDecl=Name:33:48 (Definition) -// CHECK-tokens: Punctuation: ")" [33:52 - 33:53] CXXMethod=getKind:33:17 +// CHECK-tokens: Punctuation: ")" [33:52 - 33:53] CXXMethod=getKind:33:17 (static) // CHECK-tokens: Punctuation: ";" [33:53 - 33:54] ClassDecl=AttributeList:12:9 (Definition) // CHECK-tokens: Punctuation: "}" [34:3 - 34:4] ClassDecl=AttributeList:12:9 (Definition) // CHECK-tokens: Punctuation: ";" [34:4 - 34:5] Namespace=clang:10:17 (Definition) @@ -456,14 +456,14 @@ AttributeList::Kind AttributeList::getKind(const IdentifierInfo * Name) { // CHECK-tokens: Punctuation: ";" [44:16 - 44:17] ClassDecl=StringRef:38:7 (Definition) // CHECK-tokens: Keyword: "static" [45:3 - 45:9] ClassDecl=StringRef:38:7 (Definition) // CHECK-tokens: Identifier: "size_t" [45:10 - 45:16] TypeRef=size_t:2:25 -// CHECK-tokens: Identifier: "min" [45:17 - 45:20] CXXMethod=min:45:17 (Definition) -// CHECK-tokens: Punctuation: "(" [45:20 - 45:21] CXXMethod=min:45:17 (Definition) +// CHECK-tokens: Identifier: "min" [45:17 - 45:20] CXXMethod=min:45:17 (Definition) (static) +// CHECK-tokens: Punctuation: "(" [45:20 - 45:21] CXXMethod=min:45:17 (Definition) (static) // CHECK-tokens: Identifier: "size_t" [45:21 - 45:27] TypeRef=size_t:2:25 // CHECK-tokens: Identifier: "a" [45:28 - 45:29] ParmDecl=a:45:28 (Definition) -// CHECK-tokens: Punctuation: "," [45:29 - 45:30] CXXMethod=min:45:17 (Definition) +// CHECK-tokens: Punctuation: "," [45:29 - 45:30] CXXMethod=min:45:17 (Definition) (static) // CHECK-tokens: Identifier: "size_t" [45:31 - 45:37] TypeRef=size_t:2:25 // CHECK-tokens: Identifier: "b" [45:38 - 45:39] ParmDecl=b:45:38 (Definition) -// CHECK-tokens: Punctuation: ")" [45:39 - 45:40] CXXMethod=min:45:17 (Definition) +// CHECK-tokens: Punctuation: ")" [45:39 - 45:40] CXXMethod=min:45:17 (Definition) (static) // CHECK-tokens: Punctuation: "{" [45:41 - 45:42] UnexposedStmt= // CHECK-tokens: Keyword: "return" [45:43 - 45:49] UnexposedStmt= // CHECK-tokens: Identifier: "a" [45:50 - 45:51] DeclRefExpr=a:45:28 @@ -893,17 +893,17 @@ AttributeList::Kind AttributeList::getKind(const IdentifierInfo * Name) { // CHECK-tokens: Identifier: "clang" [98:17 - 98:22] NamespaceRef=clang:10:17 // CHECK-tokens: Punctuation: ";" [98:22 - 98:23] // CHECK-tokens: Identifier: "AttributeList" [100:1 - 100:14] TypeRef=class clang::AttributeList:12:9 -// CHECK-tokens: Punctuation: "::" [100:14 - 100:16] CXXMethod=getKind:100:36 (Definition) +// CHECK-tokens: Punctuation: "::" [100:14 - 100:16] CXXMethod=getKind:100:36 (Definition) (static) // CHECK-tokens: Identifier: "Kind" [100:16 - 100:20] TypeRef=enum clang::AttributeList::Kind:13:10 // CHECK-tokens: Identifier: "AttributeList" [100:21 - 100:34] TypeRef=class clang::AttributeList:12:9 -// CHECK-tokens: Punctuation: "::" [100:34 - 100:36] CXXMethod=getKind:100:36 (Definition) -// CHECK-tokens: Identifier: "getKind" [100:36 - 100:43] CXXMethod=getKind:100:36 (Definition) -// CHECK-tokens: Punctuation: "(" [100:43 - 100:44] CXXMethod=getKind:100:36 (Definition) -// CHECK-tokens: Keyword: "const" [100:44 - 100:49] CXXMethod=getKind:100:36 (Definition) +// CHECK-tokens: Punctuation: "::" [100:34 - 100:36] CXXMethod=getKind:100:36 (Definition) (static) +// CHECK-tokens: Identifier: "getKind" [100:36 - 100:43] CXXMethod=getKind:100:36 (Definition) (static) +// CHECK-tokens: Punctuation: "(" [100:43 - 100:44] CXXMethod=getKind:100:36 (Definition) (static) +// CHECK-tokens: Keyword: "const" [100:44 - 100:49] CXXMethod=getKind:100:36 (Definition) (static) // CHECK-tokens: Identifier: "IdentifierInfo" [100:50 - 100:64] TypeRef=class clang::IdentifierInfo:66:7 // CHECK-tokens: Punctuation: "*" [100:65 - 100:66] ParmDecl=Name:100:67 (Definition) // CHECK-tokens: Identifier: "Name" [100:67 - 100:71] ParmDecl=Name:100:67 (Definition) -// CHECK-tokens: Punctuation: ")" [100:71 - 100:72] CXXMethod=getKind:100:36 (Definition) +// CHECK-tokens: Punctuation: ")" [100:71 - 100:72] CXXMethod=getKind:100:36 (Definition) (static) // CHECK-tokens: Punctuation: "{" [100:73 - 100:74] UnexposedStmt= // CHECK-tokens: Identifier: "llvm" [101:3 - 101:7] NamespaceRef=llvm:82:11 // CHECK-tokens: Punctuation: "::" [101:7 - 101:9] VarDecl=AttrName:101:19 (Definition) @@ -1616,7 +1616,7 @@ AttributeList::Kind AttributeList::getKind(const IdentifierInfo * Name) { // CHECK: 30:40: EnumConstantDecl=AT_init_priority:30:40 (Definition) Extent=[30:40 - 30:56] // CHECK: 31:7: EnumConstantDecl=IgnoredAttribute:31:7 (Definition) Extent=[31:7 - 31:23] // CHECK: 31:25: EnumConstantDecl=UnknownAttribute:31:25 (Definition) Extent=[31:25 - 31:41] -// CHECK: 33:17: CXXMethod=getKind:33:17 Extent=[33:5 - 33:53] +// CHECK: 33:17: CXXMethod=getKind:33:17 (static) Extent=[33:5 - 33:53] // CHECK: 33:12: TypeRef=enum clang::AttributeList::Kind:13:10 Extent=[33:12 - 33:16] // CHECK: 33:48: ParmDecl=Name:33:48 (Definition) Extent=[33:25 - 33:52] // CHECK: 33:31: TypeRef=class clang::IdentifierInfo:66:7 Extent=[33:31 - 33:45] @@ -1638,7 +1638,7 @@ AttributeList::Kind AttributeList::getKind(const IdentifierInfo * Name) { // CHECK: 43:15: FieldDecl=Data:43:15 (Definition) Extent=[43:3 - 43:19] // CHECK: 44:10: FieldDecl=Length:44:10 (Definition) Extent=[44:3 - 44:16] // CHECK: 44:3: TypeRef=size_t:2:25 Extent=[44:3 - 44:9] -// CHECK: 45:17: CXXMethod=min:45:17 (Definition) Extent=[45:3 - 45:66] +// CHECK: 45:17: CXXMethod=min:45:17 (Definition) (static) Extent=[45:3 - 45:66] // CHECK: 45:10: TypeRef=size_t:2:25 Extent=[45:10 - 45:16] // CHECK: 45:28: ParmDecl=a:45:28 (Definition) Extent=[45:21 - 45:29] // CHECK: 45:21: TypeRef=size_t:2:25 Extent=[45:21 - 45:27] @@ -1865,7 +1865,7 @@ AttributeList::Kind AttributeList::getKind(const IdentifierInfo * Name) { // CHECK: 93:12: DeclRefExpr=Value:92:23 Extent=[93:12 - 93:17] // CHECK: 98:17: UsingDirective=:98:17 Extent=[98:1 - 98:22] // CHECK: 98:17: NamespaceRef=clang:10:17 Extent=[98:17 - 98:22] -// CHECK: 100:36: CXXMethod=getKind:100:36 (Definition) Extent=[100:1 - 186:2] +// CHECK: 100:36: CXXMethod=getKind:100:36 (Definition) (static) Extent=[100:1 - 186:2] // CHECK: 100:21: TypeRef=class clang::AttributeList:12:9 Extent=[100:21 - 100:34] // CHECK: 100:67: ParmDecl=Name:100:67 (Definition) Extent=[100:44 - 100:71] // CHECK: 100:50: TypeRef=class clang::IdentifierInfo:66:7 Extent=[100:50 - 100:64] diff --git a/test/Index/usrs.cpp b/test/Index/usrs.cpp index a43b689..023818c 100644 --- a/test/Index/usrs.cpp +++ b/test/Index/usrs.cpp @@ -65,6 +65,20 @@ using foo::ClsB; namespace foo_alias3 = foo; +namespace { +class RDar9371763_Foo { +public: + void bar(); +}; +} + +void RDar9371763_Foo::bar() {} + +void rdar9371763() { + RDar9371763_Foo foo; + foo.bar(); +} + // RUN: c-index-test -test-load-source-usrs all %s | FileCheck %s // CHECK: usrs.cpp c:@N@foo Extent=[1:1 - 4:2] // CHECK: usrs.cpp c:@N@foo@x Extent=[2:3 - 2:8] @@ -122,3 +136,11 @@ namespace foo_alias3 = foo; // CHECK: usrs.cpp c:@NA@foo_alias2 // CHECK-NOT: ClsB // CHECK: usrs.cpp c:@NA@foo_alias3 +// CHECK: usrs.cpp c:@aN Extent=[68:1 - 73:2] +// CHECK: usrs.cpp c:@aN@C@RDar9371763_Foo Extent=[69:1 - 72:2] +// CHECK: usrs.cpp c: Extent=[70:1 - 70:8] +// CHECK: usrs.cpp c:usrs.cpp@1131@aN@C@RDar9371763_Foo@F@bar# Extent=[71:3 - 71:13] +// CHECK: usrs.cpp c:usrs.cpp@1131@aN@C@RDar9371763_Foo@F@bar# Extent=[75:1 - 75:31] +// CHECK: usrs.cpp c:@F@rdar9371763# Extent=[77:1 - 80:2] +// CHECK: usrs.cpp c:usrs.cpp@1204@F@rdar9371763#@foo Extent=[78:3 - 78:22] + diff --git a/test/Index/usrs.m b/test/Index/usrs.m index 4b79fdc..2830647 100644 --- a/test/Index/usrs.m +++ b/test/Index/usrs.m @@ -195,7 +195,7 @@ int test_multi_declaration(void) { // CHECK-source: usrs.m:42:10: UnexposedExpr= Extent=[42:10 - 42:11] // CHECK-source: usrs.m:42:10: UnexposedExpr= Extent=[42:10 - 42:11] // CHECK-source: usrs.m:44:13: ObjCIvarDecl=d1:44:13 (Definition) Extent=[44:13 - 44:15] -// CHECK-source: usrs.m:44:13: UnexposedDecl=d1:31:15 (Definition) Extent=[44:1 - 44:15] +// CHECK-source: usrs.m:44:13: ObjCSynthesizeDecl=d1:31:15 (Definition) Extent=[44:1 - 44:15] // CHECK-source: usrs.m:47:5: VarDecl=z:47:5 Extent=[47:1 - 47:6] // CHECK-source: usrs.m:49:12: FunctionDecl=local_func:49:12 (Definition) Extent=[49:1 - 49:43] // CHECK-source: usrs.m:49:27: ParmDecl=x:49:27 (Definition) Extent=[49:23 - 49:28] |