[clang][modules] Don't prevent translation of FW_Private includes when explicitly...
[llvm-project.git] / clang / test / ExtractAPI / class_template_partial_spec.cpp
blob294bbb726bcf08cff97bc8fa73399c8bdf79f189
1 // RUN: rm -rf %t
2 // RUN: split-file %s %t
3 // RUN: sed -e "s@INPUT_DIR@%{/t:regex_replacement}@g" \
4 // RUN: %t/reference.output.json.in >> %t/reference.output.json
5 // RUN: %clang_cc1 -extract-api -triple arm64-apple-macosx \
6 // RUN: -x c++-header %t/input.h -o %t/output.json -verify
8 // Generator version is not consistent across test runs, normalize it.
9 // RUN: sed -e "s@\"generator\": \".*\"@\"generator\": \"?\"@g" \
10 // RUN: %t/output.json >> %t/output-normalized.json
11 // RUN: diff %t/reference.output.json %t/output-normalized.json
13 //--- input.h
14 template<typename X, typename Y> class Foo {};
16 template<typename Z> class Foo<Z, int> {};
18 /// expected-no-diagnostics
20 //--- reference.output.json.in
22 "metadata": {
23 "formatVersion": {
24 "major": 0,
25 "minor": 5,
26 "patch": 3
28 "generator": "?"
30 "module": {
31 "name": "",
32 "platform": {
33 "architecture": "arm64",
34 "operatingSystem": {
35 "minimumVersion": {
36 "major": 11,
37 "minor": 0,
38 "patch": 0
40 "name": "macosx"
42 "vendor": "apple"
45 "relationships": [],
46 "symbols": [
48 "accessLevel": "public",
49 "declarationFragments": [
51 "kind": "keyword",
52 "spelling": "template"
55 "kind": "text",
56 "spelling": "<"
59 "kind": "keyword",
60 "spelling": "typename"
63 "kind": "text",
64 "spelling": " "
67 "kind": "genericParameter",
68 "spelling": "X"
71 "kind": "text",
72 "spelling": ", "
75 "kind": "keyword",
76 "spelling": "typename"
79 "kind": "text",
80 "spelling": " "
83 "kind": "genericParameter",
84 "spelling": "Y"
87 "kind": "text",
88 "spelling": "> "
91 "kind": "keyword",
92 "spelling": "class"
95 "kind": "text",
96 "spelling": " "
99 "kind": "identifier",
100 "spelling": "Foo"
103 "kind": "text",
104 "spelling": ";"
107 "identifier": {
108 "interfaceLanguage": "c++",
109 "precise": "c:@ST>2#T#T@Foo"
111 "kind": {
112 "displayName": "Class",
113 "identifier": "c++.class"
115 "location": {
116 "position": {
117 "character": 40,
118 "line": 1
120 "uri": "file://INPUT_DIR/input.h"
122 "names": {
123 "navigator": [
125 "kind": "identifier",
126 "spelling": "Foo"
129 "subHeading": [
131 "kind": "identifier",
132 "spelling": "Foo"
135 "title": "Foo"
137 "pathComponents": [
138 "Foo"
140 "swiftGenerics": {
141 "parameters": [
143 "depth": 0,
144 "index": 0,
145 "name": "X"
148 "depth": 0,
149 "index": 1,
150 "name": "Y"
156 "accessLevel": "public",
157 "declarationFragments": [
159 "kind": "keyword",
160 "spelling": "template"
163 "kind": "text",
164 "spelling": "<"
167 "kind": "keyword",
168 "spelling": "typename"
171 "kind": "text",
172 "spelling": " "
175 "kind": "genericParameter",
176 "spelling": "Z"
179 "kind": "text",
180 "spelling": "> "
183 "kind": "keyword",
184 "spelling": "class"
187 "kind": "text",
188 "spelling": " "
191 "kind": "identifier",
192 "spelling": "Foo"
195 "kind": "text",
196 "spelling": "<"
199 "kind": "typeIdentifier",
200 "preciseIdentifier": "c:t0.0",
201 "spelling": "Z"
204 "kind": "text",
205 "spelling": ", "
208 "kind": "typeIdentifier",
209 "preciseIdentifier": "c:I",
210 "spelling": "int"
213 "kind": "text",
214 "spelling": ">;"
217 "identifier": {
218 "interfaceLanguage": "c++",
219 "precise": "c:@SP>1#T@Foo>#t0.0#I"
221 "kind": {
222 "displayName": "Class",
223 "identifier": "c++.class"
225 "location": {
226 "position": {
227 "character": 28,
228 "line": 3
230 "uri": "file://INPUT_DIR/input.h"
232 "names": {
233 "navigator": [
235 "kind": "identifier",
236 "spelling": "Foo"
239 "subHeading": [
241 "kind": "identifier",
242 "spelling": "Foo"
245 "title": "Foo"
247 "pathComponents": [
248 "Foo"
250 "swiftGenerics": {
251 "parameters": [
253 "depth": 0,
254 "index": 0,
255 "name": "Z"