[clang-cl] Ignore /Wv and /Wv:17 flags
[llvm-project.git] / clang / test / ExtractAPI / enum.c
blobf3b5cc8e08c74c78ec18d8301306f4902d0691f3
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 -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 /// Kinds of vehicles
18 enum Vehicle {
19 Bicycle,
20 Car,
21 Train, ///< Move this to the top! -Sheldon
22 Ship,
23 Airplane,
26 enum Direction : unsigned char {
27 North = 0,
28 East,
29 South,
30 West
33 //--- reference.output.json.in
35 "metadata": {
36 "formatVersion": {
37 "major": 0,
38 "minor": 5,
39 "patch": 3
41 "generator": "?"
43 "module": {
44 "name": "",
45 "platform": {
46 "architecture": "arm64",
47 "operatingSystem": {
48 "minimumVersion": {
49 "major": 11,
50 "minor": 0,
51 "patch": 0
53 "name": "macosx"
55 "vendor": "apple"
58 "relationhips": [
60 "kind": "memberOf",
61 "source": "c:@E@Vehicle@Bicycle",
62 "target": "c:@E@Vehicle"
65 "kind": "memberOf",
66 "source": "c:@E@Vehicle@Car",
67 "target": "c:@E@Vehicle"
70 "kind": "memberOf",
71 "source": "c:@E@Vehicle@Train",
72 "target": "c:@E@Vehicle"
75 "kind": "memberOf",
76 "source": "c:@E@Vehicle@Ship",
77 "target": "c:@E@Vehicle"
80 "kind": "memberOf",
81 "source": "c:@E@Vehicle@Airplane",
82 "target": "c:@E@Vehicle"
85 "kind": "memberOf",
86 "source": "c:@E@Direction@North",
87 "target": "c:@E@Direction"
90 "kind": "memberOf",
91 "source": "c:@E@Direction@East",
92 "target": "c:@E@Direction"
95 "kind": "memberOf",
96 "source": "c:@E@Direction@South",
97 "target": "c:@E@Direction"
100 "kind": "memberOf",
101 "source": "c:@E@Direction@West",
102 "target": "c:@E@Direction"
105 "symbols": [
107 "declarationFragments": [
109 "kind": "keyword",
110 "spelling": "enum"
113 "kind": "text",
114 "spelling": " "
117 "kind": "identifier",
118 "spelling": "Vehicle"
121 "kind": "text",
122 "spelling": ": "
125 "kind": "typeIdentifier",
126 "preciseIdentifier": "c:i",
127 "spelling": "unsigned int"
130 "docComment": {
131 "lines": [
133 "range": {
134 "end": {
135 "character": 22,
136 "line": 1
138 "start": {
139 "character": 5,
140 "line": 1
143 "text": "Kinds of vehicles"
147 "identifier": {
148 "interfaceLanguage": "c",
149 "precise": "c:@E@Vehicle"
151 "kind": {
152 "displayName": "Enumeration",
153 "identifier": "c.enum"
155 "location": {
156 "character": 6,
157 "line": 2,
158 "uri": "file://INPUT_DIR/input.h"
160 "names": {
161 "subHeading": [
163 "kind": "identifier",
164 "spelling": "Vehicle"
167 "title": "Vehicle"
171 "declarationFragments": [
173 "kind": "identifier",
174 "spelling": "Bicycle"
177 "identifier": {
178 "interfaceLanguage": "c",
179 "precise": "c:@E@Vehicle@Bicycle"
181 "kind": {
182 "displayName": "Enumeration Case",
183 "identifier": "c.enum.case"
185 "location": {
186 "character": 3,
187 "line": 3,
188 "uri": "file://INPUT_DIR/input.h"
190 "names": {
191 "subHeading": [
193 "kind": "identifier",
194 "spelling": "Bicycle"
197 "title": "Bicycle"
201 "declarationFragments": [
203 "kind": "identifier",
204 "spelling": "Car"
207 "identifier": {
208 "interfaceLanguage": "c",
209 "precise": "c:@E@Vehicle@Car"
211 "kind": {
212 "displayName": "Enumeration Case",
213 "identifier": "c.enum.case"
215 "location": {
216 "character": 3,
217 "line": 4,
218 "uri": "file://INPUT_DIR/input.h"
220 "names": {
221 "subHeading": [
223 "kind": "identifier",
224 "spelling": "Car"
227 "title": "Car"
231 "declarationFragments": [
233 "kind": "identifier",
234 "spelling": "Train"
237 "docComment": {
238 "lines": [
240 "range": {
241 "end": {
242 "character": 45,
243 "line": 5
245 "start": {
246 "character": 15,
247 "line": 5
250 "text": "Move this to the top! -Sheldon"
254 "identifier": {
255 "interfaceLanguage": "c",
256 "precise": "c:@E@Vehicle@Train"
258 "kind": {
259 "displayName": "Enumeration Case",
260 "identifier": "c.enum.case"
262 "location": {
263 "character": 3,
264 "line": 5,
265 "uri": "file://INPUT_DIR/input.h"
267 "names": {
268 "subHeading": [
270 "kind": "identifier",
271 "spelling": "Train"
274 "title": "Train"
278 "declarationFragments": [
280 "kind": "identifier",
281 "spelling": "Ship"
284 "identifier": {
285 "interfaceLanguage": "c",
286 "precise": "c:@E@Vehicle@Ship"
288 "kind": {
289 "displayName": "Enumeration Case",
290 "identifier": "c.enum.case"
292 "location": {
293 "character": 3,
294 "line": 6,
295 "uri": "file://INPUT_DIR/input.h"
297 "names": {
298 "subHeading": [
300 "kind": "identifier",
301 "spelling": "Ship"
304 "title": "Ship"
308 "declarationFragments": [
310 "kind": "identifier",
311 "spelling": "Airplane"
314 "identifier": {
315 "interfaceLanguage": "c",
316 "precise": "c:@E@Vehicle@Airplane"
318 "kind": {
319 "displayName": "Enumeration Case",
320 "identifier": "c.enum.case"
322 "location": {
323 "character": 3,
324 "line": 7,
325 "uri": "file://INPUT_DIR/input.h"
327 "names": {
328 "subHeading": [
330 "kind": "identifier",
331 "spelling": "Airplane"
334 "title": "Airplane"
338 "declarationFragments": [
340 "kind": "keyword",
341 "spelling": "enum"
344 "kind": "text",
345 "spelling": " "
348 "kind": "identifier",
349 "spelling": "Direction"
352 "kind": "text",
353 "spelling": ": "
356 "kind": "typeIdentifier",
357 "preciseIdentifier": "c:c",
358 "spelling": "unsigned char"
361 "identifier": {
362 "interfaceLanguage": "c",
363 "precise": "c:@E@Direction"
365 "kind": {
366 "displayName": "Enumeration",
367 "identifier": "c.enum"
369 "location": {
370 "character": 6,
371 "line": 10,
372 "uri": "file://INPUT_DIR/input.h"
374 "names": {
375 "subHeading": [
377 "kind": "identifier",
378 "spelling": "Direction"
381 "title": "Direction"
385 "declarationFragments": [
387 "kind": "identifier",
388 "spelling": "North"
391 "identifier": {
392 "interfaceLanguage": "c",
393 "precise": "c:@E@Direction@North"
395 "kind": {
396 "displayName": "Enumeration Case",
397 "identifier": "c.enum.case"
399 "location": {
400 "character": 3,
401 "line": 11,
402 "uri": "file://INPUT_DIR/input.h"
404 "names": {
405 "subHeading": [
407 "kind": "identifier",
408 "spelling": "North"
411 "title": "North"
415 "declarationFragments": [
417 "kind": "identifier",
418 "spelling": "East"
421 "identifier": {
422 "interfaceLanguage": "c",
423 "precise": "c:@E@Direction@East"
425 "kind": {
426 "displayName": "Enumeration Case",
427 "identifier": "c.enum.case"
429 "location": {
430 "character": 3,
431 "line": 12,
432 "uri": "file://INPUT_DIR/input.h"
434 "names": {
435 "subHeading": [
437 "kind": "identifier",
438 "spelling": "East"
441 "title": "East"
445 "declarationFragments": [
447 "kind": "identifier",
448 "spelling": "South"
451 "identifier": {
452 "interfaceLanguage": "c",
453 "precise": "c:@E@Direction@South"
455 "kind": {
456 "displayName": "Enumeration Case",
457 "identifier": "c.enum.case"
459 "location": {
460 "character": 3,
461 "line": 13,
462 "uri": "file://INPUT_DIR/input.h"
464 "names": {
465 "subHeading": [
467 "kind": "identifier",
468 "spelling": "South"
471 "title": "South"
475 "declarationFragments": [
477 "kind": "identifier",
478 "spelling": "West"
481 "identifier": {
482 "interfaceLanguage": "c",
483 "precise": "c:@E@Direction@West"
485 "kind": {
486 "displayName": "Enumeration Case",
487 "identifier": "c.enum.case"
489 "location": {
490 "character": 3,
491 "line": 14,
492 "uri": "file://INPUT_DIR/input.h"
494 "names": {
495 "subHeading": [
497 "kind": "identifier",
498 "spelling": "West"
501 "title": "West"