[clang-cl] Ignore /Wv and /Wv:17 flags
[llvm-project.git] / clang / test / ExtractAPI / global_record.c
blob7193ba11b4be118b36ed5edf2389393c66d6ea51
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/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
13 // CHECK-NOT: error:
14 // CHECK-NOT: warning:
16 //--- input.h
17 int num;
19 /**
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
31 "metadata": {
32 "formatVersion": {
33 "major": 0,
34 "minor": 5,
35 "patch": 3
37 "generator": "?"
39 "module": {
40 "name": "GlobalRecord",
41 "platform": {
42 "architecture": "arm64",
43 "operatingSystem": {
44 "minimumVersion": {
45 "major": 11,
46 "minor": 0,
47 "patch": 0
49 "name": "macosx"
51 "vendor": "apple"
54 "relationhips": [],
55 "symbols": [
57 "declarationFragments": [
59 "kind": "typeIdentifier",
60 "preciseIdentifier": "c:I",
61 "spelling": "int"
64 "kind": "text",
65 "spelling": " "
68 "kind": "identifier",
69 "spelling": "num"
72 "identifier": {
73 "interfaceLanguage": "c",
74 "precise": "c:@num"
76 "kind": {
77 "displayName": "Global Variable",
78 "identifier": "c.var"
80 "location": {
81 "character": 5,
82 "line": 1,
83 "uri": "file://INPUT_DIR/input.h"
85 "names": {
86 "subHeading": [
88 "kind": "identifier",
89 "spelling": "num"
92 "title": "num"
96 "declarationFragments": [
98 "kind": "typeIdentifier",
99 "preciseIdentifier": "c:v",
100 "spelling": "void"
103 "kind": "text",
104 "spelling": " "
107 "kind": "identifier",
108 "spelling": "add"
111 "kind": "text",
112 "spelling": "("
115 "kind": "keyword",
116 "spelling": "const"
119 "kind": "text",
120 "spelling": " "
123 "kind": "typeIdentifier",
124 "preciseIdentifier": "c:I",
125 "spelling": "int"
128 "kind": "text",
129 "spelling": " "
132 "kind": "internalParam",
133 "spelling": "x"
136 "kind": "text",
137 "spelling": ", "
140 "kind": "keyword",
141 "spelling": "const"
144 "kind": "text",
145 "spelling": " "
148 "kind": "typeIdentifier",
149 "preciseIdentifier": "c:I",
150 "spelling": "int"
153 "kind": "text",
154 "spelling": " "
157 "kind": "internalParam",
158 "spelling": "y"
161 "kind": "text",
162 "spelling": ", "
165 "kind": "typeIdentifier",
166 "preciseIdentifier": "c:I",
167 "spelling": "int"
170 "kind": "text",
171 "spelling": " *"
174 "kind": "internalParam",
175 "spelling": "res"
178 "kind": "text",
179 "spelling": ")"
182 "docComment": {
183 "lines": [
185 "range": {
186 "end": {
187 "character": 4,
188 "line": 3
190 "start": {
191 "character": 4,
192 "line": 3
195 "text": ""
198 "range": {
199 "end": {
200 "character": 27,
201 "line": 4
203 "start": {
204 "character": 3,
205 "line": 4
208 "text": " \\brief Add two numbers."
211 "range": {
212 "end": {
213 "character": 30,
214 "line": 5
216 "start": {
217 "character": 3,
218 "line": 5
221 "text": " \\param [in] x A number."
224 "range": {
225 "end": {
226 "character": 36,
227 "line": 6
229 "start": {
230 "character": 3,
231 "line": 6
234 "text": " \\param [in] y Another number."
237 "range": {
238 "end": {
239 "character": 41,
240 "line": 7
242 "start": {
243 "character": 3,
244 "line": 7
247 "text": " \\param [out] res The result of x + y."
250 "range": {
251 "end": {
252 "character": 4,
253 "line": 8
255 "start": {
256 "character": 1,
257 "line": 8
260 "text": " "
264 "identifier": {
265 "interfaceLanguage": "c",
266 "precise": "c:@F@add"
268 "kind": {
269 "displayName": "Function",
270 "identifier": "c.func"
272 "location": {
273 "character": 6,
274 "line": 9,
275 "uri": "file://INPUT_DIR/input.h"
277 "names": {
278 "subHeading": [
280 "kind": "identifier",
281 "spelling": "add"
284 "title": "add"
286 "parameters": {
287 "parameters": [
289 "declarationFragments": [
291 "kind": "keyword",
292 "spelling": "const"
295 "kind": "text",
296 "spelling": " "
299 "kind": "typeIdentifier",
300 "preciseIdentifier": "c:I",
301 "spelling": "int"
304 "kind": "text",
305 "spelling": " "
308 "kind": "internalParam",
309 "spelling": "x"
312 "name": "x"
315 "declarationFragments": [
317 "kind": "keyword",
318 "spelling": "const"
321 "kind": "text",
322 "spelling": " "
325 "kind": "typeIdentifier",
326 "preciseIdentifier": "c:I",
327 "spelling": "int"
330 "kind": "text",
331 "spelling": " "
334 "kind": "internalParam",
335 "spelling": "y"
338 "name": "y"
341 "declarationFragments": [
343 "kind": "typeIdentifier",
344 "preciseIdentifier": "c:I",
345 "spelling": "int"
348 "kind": "text",
349 "spelling": " *"
352 "kind": "internalParam",
353 "spelling": "res"
356 "name": "res"
359 "returns": [
361 "kind": "typeIdentifier",
362 "preciseIdentifier": "c:v",
363 "spelling": "void"