diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/Index/index-templates.cpp | 19 | ||||
-rw-r--r-- | test/Index/load-namespaces.cpp | 10 | ||||
-rw-r--r-- | test/Index/usrs.cpp | 6 |
3 files changed, 35 insertions, 0 deletions
diff --git a/test/Index/index-templates.cpp b/test/Index/index-templates.cpp index 9b86018009..09512630f1 100644 --- a/test/Index/index-templates.cpp +++ b/test/Index/index-templates.cpp @@ -24,6 +24,14 @@ class vector<Z2> { void clear(); }; +template<typename T, typename U> +struct Y { + using typename T::type; + using U::operator Z2; +}; + +struct Z3 { }; + // RUN: c-index-test -test-load-source all %s | FileCheck -check-prefix=CHECK-LOAD %s // CHECK-LOAD: index-templates.cpp:4:6: FunctionTemplate=f:4:6 Extent=[3:1 - 4:22] // CHECK-LOAD: index-templates.cpp:3:19: TemplateTypeParameter=T:3:19 (Definition) Extent=[3:19 - 3:20] @@ -50,6 +58,12 @@ class vector<Z2> { // CHECK-LOAD: index-templates.cpp:23:7: ClassDecl=vector:23:7 (Definition) Extent=[22:1 - 25:2] // CHECK-LOAD: index-templates.cpp:23:14: TypeRef=struct Z2:20:8 Extent=[23:14 - 23:16] // CHECK-LOAD: index-templates.cpp:24:8: CXXMethod=clear:24:8 Extent=[24:8 - 24:15] +// CHECK-LOAD: index-templates.cpp:28:8: ClassTemplate=Y:28:8 (Definition) Extent=[27:1 - 31:2] +// CHECK-LOAD: index-templates.cpp:27:19: TemplateTypeParameter=T:27:19 (Definition) Extent=[27:19 - 27:20] +// CHECK-LOAD: index-templates.cpp:27:31: TemplateTypeParameter=U:27:31 (Definition) Extent=[27:31 - 27:32] +// CHECK-LOAD: index-templates.cpp:29:21: UsingDeclaration=type:29:21 Extent=[29:3 - 29:25] +// CHECK-LOAD: index-templates.cpp:30:12: UsingDeclaration=operator Z2:30:12 Extent=[30:3 - 30:23] +// CHECK-LOAD: index-templates.cpp:30:21: TypeRef=struct Z2:20:8 Extent=[30:21 - 30:23] // RUN: c-index-test -test-load-source-usrs all %s | FileCheck -check-prefix=CHECK-USRS %s // CHECK-USRS: index-templates.cpp c:@FT@>3#T#Nt0.0#t>2#T#Nt1.0f#>t0.22t0.0# Extent=[3:1 - 4:22] @@ -70,3 +84,8 @@ class vector<Z2> { // CHECK-USRS: index-templates.cpp c:@S@Z2 Extent=[20:1 - 20:14] // CHECK-USRS: index-templates.cpp c:@C@vector>#$@S@Z2#$@C@allocator>#$@S@Z2 Extent=[22:1 - 25:2] // CHECK-USRS: index-templates.cpp c:@C@vector>#$@S@Z2#$@C@allocator>#$@S@Z2@F@clear# Extent=[24:8 - 24:15] +// CHECK-USRS: index-templates.cpp c:@ST>2#T#T@Y Extent=[27:1 - 31:2] +// CHECK-USRS: index-templates.cpp c:index-templates.cpp@452 Extent=[27:19 - 27:20] +// CHECK-USRS: index-templates.cpp c:index-templates.cpp@464 Extent=[27:31 - 27:32] +// CHECK-USRS-NOT: type +// CHECK-USRS: index-templates.cpp c:@S@Z3 Extent=[33:1 - 33:14] diff --git a/test/Index/load-namespaces.cpp b/test/Index/load-namespaces.cpp index 9c8db0a3a5..adb6183d17 100644 --- a/test/Index/load-namespaces.cpp +++ b/test/Index/load-namespaces.cpp @@ -15,6 +15,12 @@ namespace std0x = std98; using namespace std0x; +namespace std { + int g(int); +} + +using std::g; + // RUN: c-index-test -test-load-source all %s | FileCheck %s // CHECK: load-namespaces.cpp:3:11: Namespace=std:3:11 (Definition) Extent=[3:11 - 7:2] // CHECK: load-namespaces.cpp:4:13: Namespace=rel_ops:4:13 (Definition) Extent=[4:13 - 6:4] @@ -27,3 +33,7 @@ using namespace std0x; // CHECK: load-namespaces.cpp:14:19: NamespaceRef=std98:13:11 Extent=[14:19 - 14:24] // CHECK: load-namespaces.cpp:16:17: UsingDirective=:16:17 Extent=[16:1 - 16:22] // CHECK: load-namespaces.cpp:16:17: NamespaceRef=std0x:14:11 Extent=[16:17 - 16:22] +// CHECK: load-namespaces.cpp:18:11: Namespace=std:18:11 (Definition) Extent=[18:11 - 20:2] +// CHECK: load-namespaces.cpp:19:7: FunctionDecl=g:19:7 Extent=[19:7 - 19:13] +// CHECK: load-namespaces.cpp:19:12: ParmDecl=:19:12 (Definition) Extent=[19:9 - 19:13] +// CHECK: load-namespaces.cpp:22:12: UsingDeclaration=g:22:12 Extent=[22:1 - 22:13] diff --git a/test/Index/usrs.cpp b/test/Index/usrs.cpp index 50d209feba..698aded843 100644 --- a/test/Index/usrs.cpp +++ b/test/Index/usrs.cpp @@ -61,6 +61,10 @@ using namespace foo; namespace foo_alias2 = foo; +using foo::ClsB; + +namespace foo_alias3 = foo; + // 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] @@ -116,3 +120,5 @@ namespace foo_alias2 = foo; // CHECK: usrs.cpp c:@NA@foo_alias // CHECK-NOT: foo // CHECK: usrs.cpp c:@NA@foo_alias2 +// CHECK-NOT: ClsB +// CHECK: usrs.cpp c:@NA@foo_alias3 |