Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / clang / test / ExtractAPI / language.c
blob3a434d475134f8a9e773e6a13a9b4e50658a53c2
1 // RUN: rm -rf %t
2 // RUN: split-file %s %t
3 // RUN: sed -e "s@INPUT_DIR@%{/t:regex_replacement}@g" \
4 // RUN: %t/c.reference.output.json.in >> %t/c.reference.output.json
5 // RUN: sed -e "s@INPUT_DIR@%{/t:regex_replacement}@g" \
6 // RUN: %t/objc.reference.output.json.in >> %t/objc.reference.output.json
8 // RUN: %clang -extract-api -x c-header -target arm64-apple-macosx \
9 // RUN: %t/c.h -o %t/c.output.json | FileCheck -allow-empty %s
10 // RUN: %clang -extract-api -x objective-c-header -target arm64-apple-macosx \
11 // RUN: %t/objc.h -o %t/objc.output.json | FileCheck -allow-empty %s
13 // Generator version is not consistent across test runs, normalize it.
14 // RUN: sed -e "s@\"generator\": \".*\"@\"generator\": \"?\"@g" \
15 // RUN: %t/c.output.json >> %t/c.output-normalized.json
16 // RUN: sed -e "s@\"generator\": \".*\"@\"generator\": \"?\"@g" \
17 // RUN: %t/objc.output.json >> %t/objc.output-normalized.json
19 // RUN: diff %t/c.reference.output.json %t/c.output-normalized.json
20 // RUN: diff %t/objc.reference.output.json %t/objc.output-normalized.json
22 // CHECK-NOT: error:
23 // CHECK-NOT: warning:
25 //--- c.h
26 char c;
28 //--- objc.h
29 char objc;
31 //--- c.reference.output.json.in
33 "metadata": {
34 "formatVersion": {
35 "major": 0,
36 "minor": 5,
37 "patch": 3
39 "generator": "?"
41 "module": {
42 "name": "",
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 "relationships": [],
57 "symbols": [
59 "accessLevel": "public",
60 "declarationFragments": [
62 "kind": "typeIdentifier",
63 "preciseIdentifier": "c:C",
64 "spelling": "char"
67 "kind": "text",
68 "spelling": " "
71 "kind": "identifier",
72 "spelling": "c"
75 "kind": "text",
76 "spelling": ";"
79 "identifier": {
80 "interfaceLanguage": "c",
81 "precise": "c:@c"
83 "kind": {
84 "displayName": "Global Variable",
85 "identifier": "c.var"
87 "location": {
88 "position": {
89 "character": 6,
90 "line": 1
92 "uri": "file://INPUT_DIR/c.h"
94 "names": {
95 "navigator": [
97 "kind": "identifier",
98 "spelling": "c"
101 "subHeading": [
103 "kind": "identifier",
104 "spelling": "c"
107 "title": "c"
109 "pathComponents": [
115 //--- objc.reference.output.json.in
117 "metadata": {
118 "formatVersion": {
119 "major": 0,
120 "minor": 5,
121 "patch": 3
123 "generator": "?"
125 "module": {
126 "name": "",
127 "platform": {
128 "architecture": "arm64",
129 "operatingSystem": {
130 "minimumVersion": {
131 "major": 11,
132 "minor": 0,
133 "patch": 0
135 "name": "macosx"
137 "vendor": "apple"
140 "relationships": [],
141 "symbols": [
143 "accessLevel": "public",
144 "declarationFragments": [
146 "kind": "typeIdentifier",
147 "preciseIdentifier": "c:C",
148 "spelling": "char"
151 "kind": "text",
152 "spelling": " "
155 "kind": "identifier",
156 "spelling": "objc"
159 "kind": "text",
160 "spelling": ";"
163 "identifier": {
164 "interfaceLanguage": "objective-c",
165 "precise": "c:@objc"
167 "kind": {
168 "displayName": "Global Variable",
169 "identifier": "objective-c.var"
171 "location": {
172 "position": {
173 "character": 6,
174 "line": 1
176 "uri": "file://INPUT_DIR/objc.h"
178 "names": {
179 "navigator": [
181 "kind": "identifier",
182 "spelling": "objc"
185 "subHeading": [
187 "kind": "identifier",
188 "spelling": "objc"
191 "title": "objc"
193 "pathComponents": [
194 "objc"