[clang][modules] Don't prevent translation of FW_Private includes when explicitly...
[llvm-project.git] / clang / test / ExtractAPI / global_func_template.cpp
blob360d3b534cbded0442b586ca46b9592e447dd956
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 T> void Foo(T Bar);
16 template<typename T> T Fizz(int Buzz);
17 /// expected-no-diagnostics
19 //--- reference.output.json.in
21 "metadata": {
22 "formatVersion": {
23 "major": 0,
24 "minor": 5,
25 "patch": 3
27 "generator": "?"
29 "module": {
30 "name": "",
31 "platform": {
32 "architecture": "arm64",
33 "operatingSystem": {
34 "minimumVersion": {
35 "major": 11,
36 "minor": 0,
37 "patch": 0
39 "name": "macosx"
41 "vendor": "apple"
44 "relationships": [],
45 "symbols": [
47 "accessLevel": "public",
48 "declarationFragments": [
50 "kind": "keyword",
51 "spelling": "template"
54 "kind": "text",
55 "spelling": "<"
58 "kind": "keyword",
59 "spelling": "typename"
62 "kind": "text",
63 "spelling": " "
66 "kind": "genericParameter",
67 "spelling": "T"
70 "kind": "text",
71 "spelling": "> "
74 "kind": "typeIdentifier",
75 "preciseIdentifier": "c:v",
76 "spelling": "void"
79 "kind": "text",
80 "spelling": " "
83 "kind": "identifier",
84 "spelling": "Foo"
87 "kind": "text",
88 "spelling": "("
91 "kind": "typeIdentifier",
92 "preciseIdentifier": "c:t0.0",
93 "spelling": "T"
96 "kind": "text",
97 "spelling": " "
100 "kind": "internalParam",
101 "spelling": "Bar"
104 "kind": "text",
105 "spelling": ");"
108 "functionSignature": {
109 "parameters": [
111 "declarationFragments": [
113 "kind": "typeIdentifier",
114 "preciseIdentifier": "c:t0.0",
115 "spelling": "T"
118 "kind": "text",
119 "spelling": " "
122 "kind": "internalParam",
123 "spelling": "Bar"
126 "name": "Bar"
129 "returns": [
131 "kind": "typeIdentifier",
132 "preciseIdentifier": "c:v",
133 "spelling": "void"
137 "identifier": {
138 "interfaceLanguage": "c++",
139 "precise": "c:@FT@>1#TFoo#t0.0#v#"
141 "kind": {
142 "displayName": "Function Template",
143 "identifier": "c++.func"
145 "location": {
146 "position": {
147 "character": 27,
148 "line": 1
150 "uri": "file://INPUT_DIR/input.h"
152 "names": {
153 "navigator": [
155 "kind": "identifier",
156 "spelling": "Foo"
159 "subHeading": [
161 "kind": "identifier",
162 "spelling": "Foo"
165 "title": "Foo"
167 "pathComponents": [
168 "Foo"
170 "swiftGenerics": {
171 "parameters": [
173 "depth": 0,
174 "index": 0,
175 "name": "T"
181 "accessLevel": "public",
182 "declarationFragments": [
184 "kind": "keyword",
185 "spelling": "template"
188 "kind": "text",
189 "spelling": "<"
192 "kind": "keyword",
193 "spelling": "typename"
196 "kind": "text",
197 "spelling": " "
200 "kind": "genericParameter",
201 "spelling": "T"
204 "kind": "text",
205 "spelling": "> "
208 "kind": "typeIdentifier",
209 "preciseIdentifier": "c:t0.0",
210 "spelling": "T"
213 "kind": "text",
214 "spelling": " "
217 "kind": "identifier",
218 "spelling": "Fizz"
221 "kind": "text",
222 "spelling": "("
225 "kind": "typeIdentifier",
226 "preciseIdentifier": "c:I",
227 "spelling": "int"
230 "kind": "text",
231 "spelling": " "
234 "kind": "internalParam",
235 "spelling": "Buzz"
238 "kind": "text",
239 "spelling": ");"
242 "functionSignature": {
243 "parameters": [
245 "declarationFragments": [
247 "kind": "typeIdentifier",
248 "preciseIdentifier": "c:I",
249 "spelling": "int"
252 "kind": "text",
253 "spelling": " "
256 "kind": "internalParam",
257 "spelling": "Buzz"
260 "name": "Buzz"
263 "returns": [
265 "kind": "typeIdentifier",
266 "preciseIdentifier": "c:t0.0",
267 "spelling": "T"
271 "identifier": {
272 "interfaceLanguage": "c++",
273 "precise": "c:@FT@>1#TFizz#I#t0.0#"
275 "kind": {
276 "displayName": "Function Template",
277 "identifier": "c++.func"
279 "location": {
280 "position": {
281 "character": 24,
282 "line": 3
284 "uri": "file://INPUT_DIR/input.h"
286 "names": {
287 "navigator": [
289 "kind": "identifier",
290 "spelling": "Fizz"
293 "subHeading": [
295 "kind": "identifier",
296 "spelling": "Fizz"
299 "title": "Fizz"
301 "pathComponents": [
302 "Fizz"
304 "swiftGenerics": {
305 "parameters": [
307 "depth": 0,
308 "index": 0,
309 "name": "T"