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/input1.h %t/input2.h %t/input3.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:
21 * \brief Add two numbers.
22 * \param [in] x A number.
23 * \param [in] y Another number.
24 * \param [out] res The result of x + y.
26 void add(const int x
, const int y
, int *res
);
29 char unavailable
__attribute__((unavailable
));
31 //--- reference.output.json.in
42 "name": "GlobalRecord",
44 "architecture": "arm64",
59 "declarationFragments": [
61 "kind": "typeIdentifier",
62 "preciseIdentifier": "c:I",
75 "interfaceLanguage": "c",
79 "displayName": "Global Variable",
85 "uri": "file://INPUT_DIR/input1.h"
98 "declarationFragments": [
100 "kind": "typeIdentifier",
101 "preciseIdentifier": "c:v",
109 "kind": "identifier",
125 "kind": "typeIdentifier",
126 "preciseIdentifier": "c:I",
134 "kind": "internalParam",
150 "kind": "typeIdentifier",
151 "preciseIdentifier": "c:I",
159 "kind": "internalParam",
167 "kind": "typeIdentifier",
168 "preciseIdentifier": "c:I",
176 "kind": "internalParam",
210 "text": " \\brief Add two numbers."
223 "text": " \\param [in] x A number."
236 "text": " \\param [in] y Another number."
249 "text": " \\param [out] res The result of x + y."
267 "interfaceLanguage": "c",
268 "precise": "c:@F@add"
271 "displayName": "Function",
272 "identifier": "c.func"
277 "uri": "file://INPUT_DIR/input2.h"
282 "kind": "identifier",
291 "declarationFragments": [
301 "kind": "typeIdentifier",
302 "preciseIdentifier": "c:I",
310 "kind": "internalParam",
317 "declarationFragments": [
327 "kind": "typeIdentifier",
328 "preciseIdentifier": "c:I",
336 "kind": "internalParam",
343 "declarationFragments": [
345 "kind": "typeIdentifier",
346 "preciseIdentifier": "c:I",
354 "kind": "internalParam",
363 "kind": "typeIdentifier",
364 "preciseIdentifier": "c:v",