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 -extract-api --pretty-sgf --product-name=GlobalRecord -target arm64-apple-macosx \
6 // RUN: %t/input.h -o %t/output.json | FileCheck -allow-empty %s
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
14 // CHECK-NOT: warning:
20 * \brief Add two numbers.
21 * \param [in] x A number.
22 * \param [in] y Another number.
23 * \param [out] res The result of x + y.
25 void add(const int x
, const int y
, int *res
);
27 char unavailable
__attribute__((unavailable
));
29 //--- reference.output.json.in
40 "name": "GlobalRecord",
42 "architecture": "arm64",
57 "accessLevel": "public",
58 "declarationFragments": [
60 "kind": "typeIdentifier",
61 "preciseIdentifier": "c:I",
78 "interfaceLanguage": "c",
82 "displayName": "Global Variable",
90 "uri": "file://INPUT_DIR/input.h"
101 "kind": "identifier",
112 "accessLevel": "public",
113 "declarationFragments": [
115 "kind": "typeIdentifier",
116 "preciseIdentifier": "c:v",
124 "kind": "identifier",
140 "kind": "typeIdentifier",
141 "preciseIdentifier": "c:I",
149 "kind": "internalParam",
165 "kind": "typeIdentifier",
166 "preciseIdentifier": "c:I",
174 "kind": "internalParam",
182 "kind": "typeIdentifier",
183 "preciseIdentifier": "c:I",
191 "kind": "internalParam",
225 "text": " \\brief Add two numbers."
238 "text": " \\param [in] x A number."
251 "text": " \\param [in] y Another number."
264 "text": " \\param [out] res The result of x + y."
281 "functionSignature": {
284 "declarationFragments": [
294 "kind": "typeIdentifier",
295 "preciseIdentifier": "c:I",
303 "kind": "internalParam",
310 "declarationFragments": [
320 "kind": "typeIdentifier",
321 "preciseIdentifier": "c:I",
329 "kind": "internalParam",
336 "declarationFragments": [
338 "kind": "typeIdentifier",
339 "preciseIdentifier": "c:I",
347 "kind": "internalParam",
356 "kind": "typeIdentifier",
357 "preciseIdentifier": "c:v",
363 "interfaceLanguage": "c",
364 "precise": "c:@F@add"
367 "displayName": "Function",
368 "identifier": "c.func"
375 "uri": "file://INPUT_DIR/input.h"
380 "kind": "identifier",
386 "kind": "identifier",