2 // RUN: split-file %s %t
3 // RUN: sed -e "s@INPUT_DIR@%/t@g" %t/reference.output.json.in >> \
4 // RUN: %t/reference.output.json
5 // RUN: %clang -extract-api --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 "declarationFragments": [
59 "kind": "typeIdentifier",
60 "preciseIdentifier": "c:I",
73 "interfaceLanguage": "c",
77 "displayName": "Global Variable",
83 "uri": "file://INPUT_DIR/input.h"
96 "declarationFragments": [
98 "kind": "typeIdentifier",
99 "preciseIdentifier": "c:v",
107 "kind": "identifier",
123 "kind": "typeIdentifier",
124 "preciseIdentifier": "c:I",
132 "kind": "internalParam",
148 "kind": "typeIdentifier",
149 "preciseIdentifier": "c:I",
157 "kind": "internalParam",
165 "kind": "typeIdentifier",
166 "preciseIdentifier": "c:I",
174 "kind": "internalParam",
208 "text": " \\brief Add two numbers."
221 "text": " \\param [in] x A number."
234 "text": " \\param [in] y Another number."
247 "text": " \\param [out] res The result of x + y."
265 "interfaceLanguage": "c",
266 "precise": "c:@F@add"
269 "displayName": "Function",
270 "identifier": "c.func"
275 "uri": "file://INPUT_DIR/input.h"
280 "kind": "identifier",
289 "declarationFragments": [
299 "kind": "typeIdentifier",
300 "preciseIdentifier": "c:I",
308 "kind": "internalParam",
315 "declarationFragments": [
325 "kind": "typeIdentifier",
326 "preciseIdentifier": "c:I",
334 "kind": "internalParam",
341 "declarationFragments": [
343 "kind": "typeIdentifier",
344 "preciseIdentifier": "c:I",
352 "kind": "internalParam",
361 "kind": "typeIdentifier",
362 "preciseIdentifier": "c:v",