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
17 void setLength(int length
) noexcept
;
20 static double getFoo();
23 constexpr int getBar() const;
25 /// expected-no-diagnostics
27 //--- reference.output.json.in
40 "architecture": "arm64",
55 "source": "c:@S@Foo@F@getCount#",
57 "targetFallback": "Foo"
61 "source": "c:@S@Foo@F@setLength#I#",
63 "targetFallback": "Foo"
67 "source": "c:@S@Foo@F@getBar#1",
69 "targetFallback": "Foo"
73 "source": "c:@S@Foo@F@getFoo#S",
75 "targetFallback": "Foo"
80 "accessLevel": "public",
81 "declarationFragments": [
100 "interfaceLanguage": "c++",
101 "precise": "c:@S@Foo"
104 "displayName": "Class",
105 "identifier": "c++.class"
112 "uri": "file://INPUT_DIR/input.h"
117 "kind": "identifier",
123 "kind": "identifier",
134 "accessLevel": "private",
135 "declarationFragments": [
137 "kind": "typeIdentifier",
138 "preciseIdentifier": "c:I",
146 "kind": "identifier",
147 "spelling": "getCount"
154 "functionSignature": {
157 "kind": "typeIdentifier",
158 "preciseIdentifier": "c:I",
164 "interfaceLanguage": "c++",
165 "precise": "c:@S@Foo@F@getCount#"
168 "displayName": "Instance Method",
169 "identifier": "c++.method"
176 "uri": "file://INPUT_DIR/input.h"
181 "kind": "identifier",
182 "spelling": "getCount"
187 "kind": "identifier",
188 "spelling": "getCount"
199 "accessLevel": "private",
200 "declarationFragments": [
202 "kind": "typeIdentifier",
203 "preciseIdentifier": "c:v",
211 "kind": "identifier",
212 "spelling": "setLength"
219 "kind": "typeIdentifier",
220 "preciseIdentifier": "c:I",
228 "kind": "internalParam",
241 "spelling": "noexcept"
248 "functionSignature": {
251 "declarationFragments": [
253 "kind": "typeIdentifier",
254 "preciseIdentifier": "c:I",
262 "kind": "internalParam",
271 "kind": "typeIdentifier",
272 "preciseIdentifier": "c:v",
278 "interfaceLanguage": "c++",
279 "precise": "c:@S@Foo@F@setLength#I#"
282 "displayName": "Instance Method",
283 "identifier": "c++.method"
290 "uri": "file://INPUT_DIR/input.h"
295 "kind": "identifier",
296 "spelling": "setLength"
301 "kind": "identifier",
302 "spelling": "setLength"
313 "accessLevel": "protected",
314 "declarationFragments": [
317 "spelling": "constexpr"
324 "kind": "typeIdentifier",
325 "preciseIdentifier": "c:I",
333 "kind": "identifier",
349 "functionSignature": {
352 "kind": "typeIdentifier",
353 "preciseIdentifier": "c:I",
359 "interfaceLanguage": "c++",
360 "precise": "c:@S@Foo@F@getBar#1"
363 "displayName": "Instance Method",
364 "identifier": "c++.method"
371 "uri": "file://INPUT_DIR/input.h"
376 "kind": "identifier",
382 "kind": "identifier",
394 "accessLevel": "public",
395 "declarationFragments": [
405 "kind": "typeIdentifier",
406 "preciseIdentifier": "c:d",
414 "kind": "identifier",
422 "functionSignature": {
425 "kind": "typeIdentifier",
426 "preciseIdentifier": "c:d",
432 "interfaceLanguage": "c++",
433 "precise": "c:@S@Foo@F@getFoo#S"
436 "displayName": "Static Method",
437 "identifier": "c++.type.method"
444 "uri": "file://INPUT_DIR/input.h"
449 "kind": "identifier",
455 "kind": "identifier",