diff options
| author | Dimitry Andric <dim@FreeBSD.org> | 2019-01-19 10:04:05 +0000 |
|---|---|---|
| committer | Dimitry Andric <dim@FreeBSD.org> | 2019-01-19 10:04:05 +0000 |
| commit | 676fbe8105eeb6ff4bb2ed261cb212fcfdbe7b63 (patch) | |
| tree | 02a1ac369cb734d0abfa5000dd86e5b7797e6a74 /test/Index/Core | |
| parent | c7e70c433efc6953dc3888b9fbf9f3512d7da2b0 (diff) | |
Notes
Diffstat (limited to 'test/Index/Core')
| -rw-r--r-- | test/Index/Core/Inputs/module/SubModA.h | 2 | ||||
| -rw-r--r-- | test/Index/Core/Inputs/module/SubSubModA.h | 2 | ||||
| -rw-r--r-- | test/Index/Core/Inputs/module/module.modulemap | 12 | ||||
| -rw-r--r-- | test/Index/Core/external-source-symbol-attr.m | 2 | ||||
| -rw-r--r-- | test/Index/Core/index-source.cpp | 2 | ||||
| -rw-r--r-- | test/Index/Core/index-source.m | 22 | ||||
| -rw-r--r-- | test/Index/Core/index-with-module.m | 10 |
7 files changed, 46 insertions, 6 deletions
diff --git a/test/Index/Core/Inputs/module/SubModA.h b/test/Index/Core/Inputs/module/SubModA.h new file mode 100644 index 000000000000..59d243ecfa64 --- /dev/null +++ b/test/Index/Core/Inputs/module/SubModA.h @@ -0,0 +1,2 @@ + +void SubModA_func(void); diff --git a/test/Index/Core/Inputs/module/SubSubModA.h b/test/Index/Core/Inputs/module/SubSubModA.h new file mode 100644 index 000000000000..51ffa910f7a3 --- /dev/null +++ b/test/Index/Core/Inputs/module/SubSubModA.h @@ -0,0 +1,2 @@ + +void SubSubModA_func(void); diff --git a/test/Index/Core/Inputs/module/module.modulemap b/test/Index/Core/Inputs/module/module.modulemap index a132562eafd8..180a4aad36dc 100644 --- a/test/Index/Core/Inputs/module/module.modulemap +++ b/test/Index/Core/Inputs/module/module.modulemap @@ -1 +1,11 @@ -module ModA { header "ModA.h" export * } +module ModA { + header "ModA.h" export * + + module SubModA { + header "SubModA.h" + + module SubSubModA { + header "SubSubModA.h" + } + } +} diff --git a/test/Index/Core/external-source-symbol-attr.m b/test/Index/Core/external-source-symbol-attr.m index cdc52966977d..41bb7a264ab3 100644 --- a/test/Index/Core/external-source-symbol-attr.m +++ b/test/Index/Core/external-source-symbol-attr.m @@ -87,7 +87,7 @@ void test2(I3 *i3, id<ExtProt2> prot2, SomeEnum some) { [i3 meth2]; // CHECK: [[@LINE-1]]:7 | instance-method/Swift | meth2 | c:@CM@modname@objc(cs)I3(im)meth2 | [prot2 meth]; - // CHECK: [[@LINE-1]]:10 | instance-method/Swift | meth | c:@M@modname@objc(pl)ExtProt2(im)meth | + // CHECK: [[@LINE-1]]:10 | instance-method(protocol)/Swift | meth | c:@M@modname@objc(pl)ExtProt2(im)meth | some = SomeEnumFirst; // CHECK: [[@LINE-1]]:10 | enumerator/Swift | SomeEnumFirst | c:@M@modname@E@SomeEnum@SomeEnumFirst | } diff --git a/test/Index/Core/index-source.cpp b/test/Index/Core/index-source.cpp index 6f485feb47c5..0bf663e30be3 100644 --- a/test/Index/Core/index-source.cpp +++ b/test/Index/Core/index-source.cpp @@ -1,4 +1,5 @@ // RUN: c-index-test core -print-source-symbols -- %s -std=c++1z -target x86_64-apple-macosx10.7 | FileCheck %s +// RUN: c-index-test core -print-source-symbols -include-locals -- %s -std=c++1z -target x86_64-apple-macosx10.7 | FileCheck -check-prefix=LOCAL %s // CHECK: [[@LINE+1]]:7 | class/C++ | Cls | [[Cls_USR:.*]] | <no-cgname> | Def | rel: 0 class Cls { public: @@ -493,6 +494,7 @@ void localStructuredBindingAndRef() { // CHECK: [[@LINE-1]]:69 | variable/C++ | structuredBinding2 | c:@N@cpp17structuredBinding@structuredBinding2 | <no-cgname> | Ref,Read,RelCont | rel: 1 // CHECK-NEXT: RelCont | localStructuredBindingAndRef | c:@N@cpp17structuredBinding@F@localStructuredBindingAndRef# // CHECK-NOT: localBinding +// LOCAL: [[@LINE-4]]:9 | variable(local)/C++ | localBinding1 | c:index-source.cpp@25382@N@cpp17structuredBinding@F@localStructuredBindingAndRef#@localBinding1 } } diff --git a/test/Index/Core/index-source.m b/test/Index/Core/index-source.m index 2931e664eac6..ed616dbc9ae6 100644 --- a/test/Index/Core/index-source.m +++ b/test/Index/Core/index-source.m @@ -2,7 +2,7 @@ // RUN: c-index-test core -print-source-symbols -include-locals -- %s -target x86_64-apple-macosx10.7 | FileCheck -check-prefix=LOCAL %s @interface Base -// CHECK: [[@LINE-1]]:12 | class/ObjC | Base | c:objc(cs)Base | _OBJC_CLASS_$_Base | Decl | rel: 0 +// CHECK: [[@LINE-1]]:12 | class/ObjC | Base | [[BASE_USR:.*]] | _OBJC_CLASS_$_Base | Decl | rel: 0 -(void)meth; // CHECK: [[@LINE-1]]:8 | instance-method/ObjC | meth | c:objc(cs)Base(im)meth | -[Base meth] | Decl,Dyn,RelChild | rel: 1 // CHECK-NEXT: RelChild | Base | c:objc(cs)Base @@ -60,7 +60,7 @@ void goo(Base *b) { Base *f = (Base *) 2; } -// CHECK: [[@LINE+1]]:11 | protocol/ObjC | Prot1 | c:objc(pl)Prot1 | <no-cgname> | Decl | rel: 0 +// CHECK: [[@LINE+1]]:11 | protocol/ObjC | Prot1 | [[PROT1_USR:.*]] | <no-cgname> | Decl | rel: 0 @protocol Prot1 @end @@ -472,3 +472,21 @@ void testImplicitProperties(ImplicitProperties *c) { } @end + +@protocol Prot3 // CHECK: [[@LINE]]:11 | protocol/ObjC | Prot3 | [[PROT3_USR:.*]] | <no-cgname> | Decl | +-(void)meth; // CHECK: [[@LINE]]:8 | instance-method(protocol)/ObjC | meth | [[PROT3_meth_USR:.*]] | -[Prot3 meth] | Decl,Dyn,RelChild | +@end + +void test_rec1() { + id<Prot3, Prot1> o1; + [o1 meth]; // CHECK: [[@LINE]]:7 | instance-method(protocol)/ObjC | meth | [[PROT3_meth_USR]] | {{.*}} | Ref,Call,Dyn,RelRec,RelCall,RelCont | rel: 3 + // CHECK-NEXT: RelCall,RelCont | test_rec1 | + // CHECK-NEXT: RelRec | Prot3 | [[PROT3_USR]] + // CHECK-NEXT: RelRec | Prot1 | [[PROT1_USR]] + Base<Prot3, Prot1> *o2; + [o2 meth]; // CHECK: [[@LINE]]:7 | instance-method/ObjC | meth | {{.*}} | Ref,Call,Dyn,RelRec,RelCall,RelCont | rel: 4 + // CHECK-NEXT: RelCall,RelCont | test_rec1 | + // CHECK-NEXT: RelRec | Base | [[BASE_USR]] + // CHECK-NEXT: RelRec | Prot3 | [[PROT3_USR]] + // CHECK-NEXT: RelRec | Prot1 | [[PROT1_USR]] +} diff --git a/test/Index/Core/index-with-module.m b/test/Index/Core/index-with-module.m index c83de63701e1..ca89c2e1de38 100644 --- a/test/Index/Core/index-with-module.m +++ b/test/Index/Core/index-with-module.m @@ -1,11 +1,17 @@ // RUN: rm -rf %t.mcp // RUN: c-index-test core -print-source-symbols -dump-imported-module-files -- %s -I %S/Inputs/module -fmodules -fmodules-cache-path=%t.mcp | FileCheck %s -// CHECK: [[@LINE+1]]:9 | module/C | ModA | Decl | +// CHECK: [[@LINE+1]]:9 | module/C | ModA | [[ModA_USR:c:@M@ModA]] | Decl | @import ModA; -// CHECK: [[@LINE+1]]:1 | module/C | ModA | Decl,Impl | +// CHECK: [[@LINE+1]]:1 | module/C | ModA | [[ModA_USR]] | Decl,Impl | #include "ModA.h" +@import ModA.SubModA.SubSubModA; +// CHECK: [[@LINE-1]]:9 | module/C | ModA | [[ModA_USR]] | Ref | +// CHECK: [[@LINE-2]]:14 | module/C | ModA.SubModA | c:@M@ModA@M@SubModA | Ref | +// CHECK: [[@LINE-3]]:22 | module/C | ModA.SubModA.SubSubModA | [[SubSubModA_USR:c:@M@ModA@M@SubModA@M@SubSubModA]] | Decl | +#include "SubSubModA.h" // CHECK: [[@LINE]]:1 | module/C | ModA.SubModA.SubSubModA | [[SubSubModA_USR]] | Decl,Impl | + void foo() { // CHECK: [[@LINE+1]]:3 | function/C | ModA_func | c:@F@ModA_func | {{.*}} | Ref,Call,RelCall,RelCont | rel: 1 ModA_func(); |
