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/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 "accessLevel": "public",
60 "declarationFragments": [
62 "kind": "typeIdentifier",
63 "preciseIdentifier": "c:I",
80 "interfaceLanguage": "c",
84 "displayName": "Global Variable",
92 "uri": "file://INPUT_DIR/input1.h"
103 "kind": "identifier",
114 "accessLevel": "public",
115 "declarationFragments": [
117 "kind": "typeIdentifier",
118 "preciseIdentifier": "c:v",
126 "kind": "identifier",
142 "kind": "typeIdentifier",
143 "preciseIdentifier": "c:I",
151 "kind": "internalParam",
167 "kind": "typeIdentifier",
168 "preciseIdentifier": "c:I",
176 "kind": "internalParam",
184 "kind": "typeIdentifier",
185 "preciseIdentifier": "c:I",
193 "kind": "internalParam",
227 "text": " \\brief Add two numbers."
240 "text": " \\param [in] x A number."
253 "text": " \\param [in] y Another number."
266 "text": " \\param [out] res The result of x + y."
283 "functionSignature": {
286 "declarationFragments": [
296 "kind": "typeIdentifier",
297 "preciseIdentifier": "c:I",
305 "kind": "internalParam",
312 "declarationFragments": [
322 "kind": "typeIdentifier",
323 "preciseIdentifier": "c:I",
331 "kind": "internalParam",
338 "declarationFragments": [
340 "kind": "typeIdentifier",
341 "preciseIdentifier": "c:I",
349 "kind": "internalParam",
358 "kind": "typeIdentifier",
359 "preciseIdentifier": "c:v",
365 "interfaceLanguage": "c",
366 "precise": "c:@F@add"
369 "displayName": "Function",
370 "identifier": "c.func"
377 "uri": "file://INPUT_DIR/input2.h"
382 "kind": "identifier",
388 "kind": "identifier",