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_cc1 -extract-api -triple arm64-apple-macosx \
6 // RUN: -x c-header %t/input.h -o %t/output.json -verify
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
18 Train
, ///< Move this to the top! -Sheldon
23 enum Direction
: unsigned char {
37 // expected-no-diagnostics
39 //--- reference.output.json.in
52 "architecture": "arm64",
67 "source": "c:@E@Vehicle@Bicycle",
68 "target": "c:@E@Vehicle",
69 "targetFallback": "Vehicle"
73 "source": "c:@E@Vehicle@Car",
74 "target": "c:@E@Vehicle",
75 "targetFallback": "Vehicle"
79 "source": "c:@E@Vehicle@Train",
80 "target": "c:@E@Vehicle",
81 "targetFallback": "Vehicle"
85 "source": "c:@E@Vehicle@Ship",
86 "target": "c:@E@Vehicle",
87 "targetFallback": "Vehicle"
91 "source": "c:@E@Vehicle@Airplane",
92 "target": "c:@E@Vehicle",
93 "targetFallback": "Vehicle"
97 "source": "c:@E@Direction@North",
98 "target": "c:@E@Direction",
99 "targetFallback": "Direction"
103 "source": "c:@E@Direction@East",
104 "target": "c:@E@Direction",
105 "targetFallback": "Direction"
109 "source": "c:@E@Direction@South",
110 "target": "c:@E@Direction",
111 "targetFallback": "Direction"
115 "source": "c:@E@Direction@West",
116 "target": "c:@E@Direction",
117 "targetFallback": "Direction"
121 "source": "c:@Ea@Constant@Constant",
122 "target": "c:@Ea@Constant",
123 "targetFallback": "enum (unnamed)"
127 "source": "c:@Ea@OtherConstant@OtherConstant",
128 "target": "c:@Ea@OtherConstant",
129 "targetFallback": "enum (unnamed)"
134 "accessLevel": "public",
135 "declarationFragments": [
145 "kind": "identifier",
146 "spelling": "Vehicle"
153 "kind": "typeIdentifier",
154 "preciseIdentifier": "c:i",
155 "spelling": "unsigned int"
175 "text": "Kinds of vehicles"
180 "interfaceLanguage": "c",
181 "precise": "c:@E@Vehicle"
184 "displayName": "Enumeration",
185 "identifier": "c.enum"
192 "uri": "file://INPUT_DIR/input.h"
197 "kind": "identifier",
198 "spelling": "Vehicle"
203 "kind": "identifier",
204 "spelling": "Vehicle"
214 "accessLevel": "public",
215 "declarationFragments": [
217 "kind": "identifier",
218 "spelling": "Bicycle"
222 "interfaceLanguage": "c",
223 "precise": "c:@E@Vehicle@Bicycle"
226 "displayName": "Enumeration Case",
227 "identifier": "c.enum.case"
234 "uri": "file://INPUT_DIR/input.h"
239 "kind": "identifier",
240 "spelling": "Bicycle"
245 "kind": "identifier",
246 "spelling": "Bicycle"
257 "accessLevel": "public",
258 "declarationFragments": [
260 "kind": "identifier",
265 "interfaceLanguage": "c",
266 "precise": "c:@E@Vehicle@Car"
269 "displayName": "Enumeration Case",
270 "identifier": "c.enum.case"
277 "uri": "file://INPUT_DIR/input.h"
282 "kind": "identifier",
288 "kind": "identifier",
300 "accessLevel": "public",
301 "declarationFragments": [
303 "kind": "identifier",
320 "text": "Move this to the top! -Sheldon"
325 "interfaceLanguage": "c",
326 "precise": "c:@E@Vehicle@Train"
329 "displayName": "Enumeration Case",
330 "identifier": "c.enum.case"
337 "uri": "file://INPUT_DIR/input.h"
342 "kind": "identifier",
348 "kind": "identifier",
360 "accessLevel": "public",
361 "declarationFragments": [
363 "kind": "identifier",
368 "interfaceLanguage": "c",
369 "precise": "c:@E@Vehicle@Ship"
372 "displayName": "Enumeration Case",
373 "identifier": "c.enum.case"
380 "uri": "file://INPUT_DIR/input.h"
385 "kind": "identifier",
391 "kind": "identifier",
403 "accessLevel": "public",
404 "declarationFragments": [
406 "kind": "identifier",
407 "spelling": "Airplane"
411 "interfaceLanguage": "c",
412 "precise": "c:@E@Vehicle@Airplane"
415 "displayName": "Enumeration Case",
416 "identifier": "c.enum.case"
423 "uri": "file://INPUT_DIR/input.h"
428 "kind": "identifier",
429 "spelling": "Airplane"
434 "kind": "identifier",
435 "spelling": "Airplane"
446 "accessLevel": "public",
447 "declarationFragments": [
457 "kind": "identifier",
458 "spelling": "Direction"
465 "kind": "typeIdentifier",
466 "preciseIdentifier": "c:c",
467 "spelling": "unsigned char"
475 "interfaceLanguage": "c",
476 "precise": "c:@E@Direction"
479 "displayName": "Enumeration",
480 "identifier": "c.enum"
487 "uri": "file://INPUT_DIR/input.h"
492 "kind": "identifier",
493 "spelling": "Direction"
498 "kind": "identifier",
499 "spelling": "Direction"
509 "accessLevel": "public",
510 "declarationFragments": [
512 "kind": "identifier",
517 "interfaceLanguage": "c",
518 "precise": "c:@E@Direction@North"
521 "displayName": "Enumeration Case",
522 "identifier": "c.enum.case"
529 "uri": "file://INPUT_DIR/input.h"
534 "kind": "identifier",
540 "kind": "identifier",
552 "accessLevel": "public",
553 "declarationFragments": [
555 "kind": "identifier",
560 "interfaceLanguage": "c",
561 "precise": "c:@E@Direction@East"
564 "displayName": "Enumeration Case",
565 "identifier": "c.enum.case"
572 "uri": "file://INPUT_DIR/input.h"
577 "kind": "identifier",
583 "kind": "identifier",
595 "accessLevel": "public",
596 "declarationFragments": [
598 "kind": "identifier",
603 "interfaceLanguage": "c",
604 "precise": "c:@E@Direction@South"
607 "displayName": "Enumeration Case",
608 "identifier": "c.enum.case"
615 "uri": "file://INPUT_DIR/input.h"
620 "kind": "identifier",
626 "kind": "identifier",
638 "accessLevel": "public",
639 "declarationFragments": [
641 "kind": "identifier",
646 "interfaceLanguage": "c",
647 "precise": "c:@E@Direction@West"
650 "displayName": "Enumeration Case",
651 "identifier": "c.enum.case"
658 "uri": "file://INPUT_DIR/input.h"
663 "kind": "identifier",
669 "kind": "identifier",
681 "accessLevel": "public",
682 "declarationFragments": [
692 "kind": "typeIdentifier",
693 "preciseIdentifier": "c:i",
694 "spelling": "unsigned int"
702 "interfaceLanguage": "c",
703 "precise": "c:@Ea@Constant"
706 "displayName": "Enumeration",
707 "identifier": "c.enum"
714 "uri": "file://INPUT_DIR/input.h"
719 "kind": "identifier",
720 "spelling": "enum (unnamed)"
723 "title": "enum (unnamed)"
730 "accessLevel": "public",
731 "declarationFragments": [
733 "kind": "identifier",
734 "spelling": "Constant"
738 "interfaceLanguage": "c",
739 "precise": "c:@Ea@Constant@Constant"
742 "displayName": "Enumeration Case",
743 "identifier": "c.enum.case"
750 "uri": "file://INPUT_DIR/input.h"
755 "kind": "identifier",
756 "spelling": "Constant"
761 "kind": "identifier",
762 "spelling": "Constant"
773 "accessLevel": "public",
774 "declarationFragments": [
784 "kind": "typeIdentifier",
785 "preciseIdentifier": "c:i",
786 "spelling": "unsigned int"
794 "interfaceLanguage": "c",
795 "precise": "c:@Ea@OtherConstant"
798 "displayName": "Enumeration",
799 "identifier": "c.enum"
806 "uri": "file://INPUT_DIR/input.h"
811 "kind": "identifier",
812 "spelling": "enum (unnamed)"
815 "title": "enum (unnamed)"
822 "accessLevel": "public",
823 "declarationFragments": [
825 "kind": "identifier",
826 "spelling": "OtherConstant"
830 "interfaceLanguage": "c",
831 "precise": "c:@Ea@OtherConstant@OtherConstant"
834 "displayName": "Enumeration Case",
835 "identifier": "c.enum.case"
842 "uri": "file://INPUT_DIR/input.h"
847 "kind": "identifier",
848 "spelling": "OtherConstant"
853 "kind": "identifier",
854 "spelling": "OtherConstant"
857 "title": "OtherConstant"