Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / clang / test / ExtractAPI / global_func_template_spec.cpp
blob4dc719536836329517f62e836b86153cdea88fac
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<> void Foo<int>(int Bar);
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": "typeIdentifier",
193 "preciseIdentifier": "c:v",
194 "spelling": "void"
197 "kind": "text",
198 "spelling": " "
201 "kind": "identifier",
202 "spelling": "Foo"
205 "kind": "text",
206 "spelling": "<"
209 "kind": "typeIdentifier",
210 "preciseIdentifier": "c:I",
211 "spelling": "int"
214 "kind": "text",
215 "spelling": ">("
218 "kind": "typeIdentifier",
219 "preciseIdentifier": "c:I",
220 "spelling": "int"
223 "kind": "text",
224 "spelling": " "
227 "kind": "internalParam",
228 "spelling": "Bar"
231 "kind": "text",
232 "spelling": ");"
235 "functionSignature": {
236 "parameters": [
238 "declarationFragments": [
240 "kind": "typeIdentifier",
241 "preciseIdentifier": "c:I",
242 "spelling": "int"
245 "kind": "text",
246 "spelling": " "
249 "kind": "internalParam",
250 "spelling": "Bar"
253 "name": "Bar"
256 "returns": [
258 "kind": "typeIdentifier",
259 "preciseIdentifier": "c:v",
260 "spelling": "void"
264 "identifier": {
265 "interfaceLanguage": "c++",
266 "precise": "c:@F@Foo<#I>#I#"
268 "kind": {
269 "displayName": "Function Template Specialization",
270 "identifier": "c++.func"
272 "location": {
273 "position": {
274 "character": 17,
275 "line": 3
277 "uri": "file://INPUT_DIR/input.h"
279 "names": {
280 "navigator": [
282 "kind": "identifier",
283 "spelling": "Foo"
286 "subHeading": [
288 "kind": "identifier",
289 "spelling": "Foo"
292 "title": "Foo"
294 "pathComponents": [
295 "Foo"