Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / clang / test / Index / ctor-init-source-loc.cpp
blobff93e58092da46c4a6d33d00fff8222b987ed84a
1 // RUN: c-index-test -test-load-source all %s -fno-delayed-template-parsing | FileCheck %s
2 template<typename MyBase>
3 struct Derived: MyBase::InnerIterator
5 Derived() : MyBase::InnerIterator() {}
6 // CHECK: TypeRef=MyBase:2:19 Extent=[5:17 - 5:23]
7 };
9 template<typename MyBase>
10 struct Derived2: MyBase::Deeper::InnerIterator
12 Derived2() : MyBase::Deeper::InnerIterator() {}
13 // CHECK: TypeRef=MyBase:9:19 Extent=[12:18 - 12:24]
16 template<typename Q>
17 struct Templ;
19 template<typename MyBase>
20 struct Derived3: Templ<MyBase>::InnerIterator
22 Derived3() : Templ<MyBase>::InnerIterator() {}
23 // CHECK: TemplateRef=Templ:17:8 Extent=[22:18 - 22:23]
24 // CHECK: TypeRef=MyBase:19:19 Extent=[22:24 - 22:30]
28 struct Outer {
29 template <typename Q>
30 struct Inner {
31 typedef Q Parm;
35 template<typename Q>
36 struct Derived4: Outer::Inner<Q>::Parm
38 Derived4() : Outer::Inner<Q>::Parm() {}
39 // CHECK: TypeRef=struct Outer:28:8 Extent=[38:18 - 38:23]
40 // CHECK: TemplateRef=Inner:30:12 Extent=[38:25 - 38:30]
41 // CHECK: TypeRef=Q:35:19 Extent=[38:31 - 38:32]
44 template<typename Q>
45 struct Derived5: Outer::Inner<Q>::Parm::InnerIterator
47 Derived5() : Outer::Inner<Q>::Parm::InnerIterator() {}
48 // CHECK: TypeRef=struct Outer:28:8 Extent=[47:18 - 47:23]
49 // CHECK: TemplateRef=Inner:30:12 Extent=[47:25 - 47:30]
50 // CHECK: TypeRef=Q:44:19 Extent=[47:31 - 47:32]
53 template<typename Q>
54 struct Derived6: Outer::Inner<Q>
56 Derived6() : Outer::Inner<Q>() {}
57 // CHECK: TypeRef=struct Outer:28:8 Extent=[56:18 - 56:23]
58 // CHECK: TemplateRef=Inner:30:12 Extent=[56:25 - 56:30]
59 // CHECK: TypeRef=Q:53:19 Extent=[56:31 - 56:32]
62 struct Base {};
64 struct Derived7: Outer::Inner<Base>::Parm
66 Derived7() : Outer::Inner<Base>::Parm() {}
67 // CHECK: TypeRef=struct Outer:28:8 Extent=[66:18 - 66:23]
68 // CHECK: TemplateRef=Inner:30:12 Extent=[66:25 - 66:30]
69 // CHECK: TypeRef=struct Base:62:8 Extent=[66:31 - 66:35]
72 struct Derived8: Outer::Inner<Base>
74 Derived8() : Outer::Inner<Base>() {}
75 // CHECK: TypeRef=struct Outer:28:8 Extent=[74:18 - 74:23]
76 // CHECK: TemplateRef=Inner:30:12 Extent=[74:25 - 74:30]
77 // CHECK: TypeRef=struct Base:62:8 Extent=[74:31 - 74:35]
80 namespace Namespace {
81 template<typename Q> struct Templ;
83 struct Outer {
84 template <typename Q>
85 struct Inner {
86 typedef Q Parm;
91 template<typename MyBase>
92 struct Derived9: Namespace::Templ<MyBase>::InnerIterator
94 Derived9() : Namespace::Templ<MyBase>::InnerIterator() {}
95 // CHECK: NamespaceRef=Namespace:80:11 Extent=[94:18 - 94:27]
96 // CHECK: TemplateRef=Templ:81:33 Extent=[94:29 - 94:34]
97 // CHECK: TypeRef=MyBase:91:19 Extent=[94:35 - 94:41]
100 template<typename MyBase>
101 struct Derived10: Namespace::Templ<MyBase>
103 Derived10() : Namespace::Templ<MyBase>() {}
104 // CHECK: NamespaceRef=Namespace:80:11 Extent=[103:19 - 103:28]
105 // CHECK: TemplateRef=Templ:81:33 Extent=[103:30 - 103:35]
106 // CHECK: TypeRef=MyBase:100:19 Extent=[103:36 - 103:42]
109 template<typename MyBase>
110 struct Derived11: Namespace::Outer::Inner<MyBase>::Parm
112 Derived11() : Namespace::Outer::Inner<MyBase>::Parm() {}
113 // CHECK: NamespaceRef=Namespace:80:11 Extent=[112:19 - 112:28]
114 // CHECK: TypeRef=struct Namespace::Outer:83:12 Extent=[112:30 - 112:35]
115 // CHECK: TemplateRef=Inner:85:16 Extent=[112:37 - 112:42]
116 // CHECK: TypeRef=MyBase:109:19 Extent=[112:43 - 112:49]