[clang-cl] Ignore /Wv and /Wv:17 flags
[llvm-project.git] / clang / test / ExtractAPI / global_record_multifile.c
blobcc5448e8382986e7e946d1e6c7d68fdc6b355948
1 // RUN: rm -rf %t
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
13 // CHECK-NOT: error:
14 // CHECK-NOT: warning:
16 //--- input1.h
17 int num;
19 //--- input2.h
20 /**
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);
28 //--- input3.h
29 char unavailable __attribute__((unavailable));
31 //--- reference.output.json.in
33 "metadata": {
34 "formatVersion": {
35 "major": 0,
36 "minor": 5,
37 "patch": 3
39 "generator": "?"
41 "module": {
42 "name": "GlobalRecord",
43 "platform": {
44 "architecture": "arm64",
45 "operatingSystem": {
46 "minimumVersion": {
47 "major": 11,
48 "minor": 0,
49 "patch": 0
51 "name": "macosx"
53 "vendor": "apple"
56 "relationhips": [],
57 "symbols": [
59 "declarationFragments": [
61 "kind": "typeIdentifier",
62 "preciseIdentifier": "c:I",
63 "spelling": "int"
66 "kind": "text",
67 "spelling": " "
70 "kind": "identifier",
71 "spelling": "num"
74 "identifier": {
75 "interfaceLanguage": "c",
76 "precise": "c:@num"
78 "kind": {
79 "displayName": "Global Variable",
80 "identifier": "c.var"
82 "location": {
83 "character": 5,
84 "line": 1,
85 "uri": "file://INPUT_DIR/input1.h"
87 "names": {
88 "subHeading": [
90 "kind": "identifier",
91 "spelling": "num"
94 "title": "num"
98 "declarationFragments": [
100 "kind": "typeIdentifier",
101 "preciseIdentifier": "c:v",
102 "spelling": "void"
105 "kind": "text",
106 "spelling": " "
109 "kind": "identifier",
110 "spelling": "add"
113 "kind": "text",
114 "spelling": "("
117 "kind": "keyword",
118 "spelling": "const"
121 "kind": "text",
122 "spelling": " "
125 "kind": "typeIdentifier",
126 "preciseIdentifier": "c:I",
127 "spelling": "int"
130 "kind": "text",
131 "spelling": " "
134 "kind": "internalParam",
135 "spelling": "x"
138 "kind": "text",
139 "spelling": ", "
142 "kind": "keyword",
143 "spelling": "const"
146 "kind": "text",
147 "spelling": " "
150 "kind": "typeIdentifier",
151 "preciseIdentifier": "c:I",
152 "spelling": "int"
155 "kind": "text",
156 "spelling": " "
159 "kind": "internalParam",
160 "spelling": "y"
163 "kind": "text",
164 "spelling": ", "
167 "kind": "typeIdentifier",
168 "preciseIdentifier": "c:I",
169 "spelling": "int"
172 "kind": "text",
173 "spelling": " *"
176 "kind": "internalParam",
177 "spelling": "res"
180 "kind": "text",
181 "spelling": ")"
184 "docComment": {
185 "lines": [
187 "range": {
188 "end": {
189 "character": 4,
190 "line": 1
192 "start": {
193 "character": 4,
194 "line": 1
197 "text": ""
200 "range": {
201 "end": {
202 "character": 27,
203 "line": 2
205 "start": {
206 "character": 3,
207 "line": 2
210 "text": " \\brief Add two numbers."
213 "range": {
214 "end": {
215 "character": 30,
216 "line": 3
218 "start": {
219 "character": 3,
220 "line": 3
223 "text": " \\param [in] x A number."
226 "range": {
227 "end": {
228 "character": 36,
229 "line": 4
231 "start": {
232 "character": 3,
233 "line": 4
236 "text": " \\param [in] y Another number."
239 "range": {
240 "end": {
241 "character": 41,
242 "line": 5
244 "start": {
245 "character": 3,
246 "line": 5
249 "text": " \\param [out] res The result of x + y."
252 "range": {
253 "end": {
254 "character": 4,
255 "line": 6
257 "start": {
258 "character": 1,
259 "line": 6
262 "text": " "
266 "identifier": {
267 "interfaceLanguage": "c",
268 "precise": "c:@F@add"
270 "kind": {
271 "displayName": "Function",
272 "identifier": "c.func"
274 "location": {
275 "character": 6,
276 "line": 7,
277 "uri": "file://INPUT_DIR/input2.h"
279 "names": {
280 "subHeading": [
282 "kind": "identifier",
283 "spelling": "add"
286 "title": "add"
288 "parameters": {
289 "parameters": [
291 "declarationFragments": [
293 "kind": "keyword",
294 "spelling": "const"
297 "kind": "text",
298 "spelling": " "
301 "kind": "typeIdentifier",
302 "preciseIdentifier": "c:I",
303 "spelling": "int"
306 "kind": "text",
307 "spelling": " "
310 "kind": "internalParam",
311 "spelling": "x"
314 "name": "x"
317 "declarationFragments": [
319 "kind": "keyword",
320 "spelling": "const"
323 "kind": "text",
324 "spelling": " "
327 "kind": "typeIdentifier",
328 "preciseIdentifier": "c:I",
329 "spelling": "int"
332 "kind": "text",
333 "spelling": " "
336 "kind": "internalParam",
337 "spelling": "y"
340 "name": "y"
343 "declarationFragments": [
345 "kind": "typeIdentifier",
346 "preciseIdentifier": "c:I",
347 "spelling": "int"
350 "kind": "text",
351 "spelling": " *"
354 "kind": "internalParam",
355 "spelling": "res"
358 "name": "res"
361 "returns": [
363 "kind": "typeIdentifier",
364 "preciseIdentifier": "c:v",
365 "spelling": "void"