Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / clang / test / ExtractAPI / struct.c
bloba77293b9a53716d4733efc7e9d35b0c1797fa32c
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/reference.output.json.in >> %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 /// Color in RGBA
18 struct Color {
19 unsigned Red;
20 unsigned Green;
21 unsigned Blue;
22 /// Alpha channel for transparency
23 unsigned Alpha;
26 //--- reference.output.json.in
28 "metadata": {
29 "formatVersion": {
30 "major": 0,
31 "minor": 5,
32 "patch": 3
34 "generator": "?"
36 "module": {
37 "name": "",
38 "platform": {
39 "architecture": "arm64",
40 "operatingSystem": {
41 "minimumVersion": {
42 "major": 11,
43 "minor": 0,
44 "patch": 0
46 "name": "macosx"
48 "vendor": "apple"
51 "relationships": [
53 "kind": "memberOf",
54 "source": "c:@S@Color@FI@Red",
55 "target": "c:@S@Color",
56 "targetFallback": "Color"
59 "kind": "memberOf",
60 "source": "c:@S@Color@FI@Green",
61 "target": "c:@S@Color",
62 "targetFallback": "Color"
65 "kind": "memberOf",
66 "source": "c:@S@Color@FI@Blue",
67 "target": "c:@S@Color",
68 "targetFallback": "Color"
71 "kind": "memberOf",
72 "source": "c:@S@Color@FI@Alpha",
73 "target": "c:@S@Color",
74 "targetFallback": "Color"
77 "symbols": [
79 "accessLevel": "public",
80 "declarationFragments": [
82 "kind": "keyword",
83 "spelling": "struct"
86 "kind": "text",
87 "spelling": " "
90 "kind": "identifier",
91 "spelling": "Color"
94 "kind": "text",
95 "spelling": ";"
98 "docComment": {
99 "lines": [
101 "range": {
102 "end": {
103 "character": 18,
104 "line": 1
106 "start": {
107 "character": 5,
108 "line": 1
111 "text": "Color in RGBA"
115 "identifier": {
116 "interfaceLanguage": "c",
117 "precise": "c:@S@Color"
119 "kind": {
120 "displayName": "Structure",
121 "identifier": "c.struct"
123 "location": {
124 "position": {
125 "character": 8,
126 "line": 2
128 "uri": "file://INPUT_DIR/input.h"
130 "names": {
131 "navigator": [
133 "kind": "identifier",
134 "spelling": "Color"
137 "subHeading": [
139 "kind": "identifier",
140 "spelling": "Color"
143 "title": "Color"
145 "pathComponents": [
146 "Color"
150 "accessLevel": "public",
151 "declarationFragments": [
153 "kind": "typeIdentifier",
154 "preciseIdentifier": "c:i",
155 "spelling": "unsigned int"
158 "kind": "text",
159 "spelling": " "
162 "kind": "identifier",
163 "spelling": "Red"
166 "kind": "text",
167 "spelling": ";"
170 "identifier": {
171 "interfaceLanguage": "c",
172 "precise": "c:@S@Color@FI@Red"
174 "kind": {
175 "displayName": "Instance Property",
176 "identifier": "c.property"
178 "location": {
179 "position": {
180 "character": 12,
181 "line": 3
183 "uri": "file://INPUT_DIR/input.h"
185 "names": {
186 "navigator": [
188 "kind": "identifier",
189 "spelling": "Red"
192 "subHeading": [
194 "kind": "identifier",
195 "spelling": "Red"
198 "title": "Red"
200 "pathComponents": [
201 "Color",
202 "Red"
206 "accessLevel": "public",
207 "declarationFragments": [
209 "kind": "typeIdentifier",
210 "preciseIdentifier": "c:i",
211 "spelling": "unsigned int"
214 "kind": "text",
215 "spelling": " "
218 "kind": "identifier",
219 "spelling": "Green"
222 "kind": "text",
223 "spelling": ";"
226 "identifier": {
227 "interfaceLanguage": "c",
228 "precise": "c:@S@Color@FI@Green"
230 "kind": {
231 "displayName": "Instance Property",
232 "identifier": "c.property"
234 "location": {
235 "position": {
236 "character": 12,
237 "line": 4
239 "uri": "file://INPUT_DIR/input.h"
241 "names": {
242 "navigator": [
244 "kind": "identifier",
245 "spelling": "Green"
248 "subHeading": [
250 "kind": "identifier",
251 "spelling": "Green"
254 "title": "Green"
256 "pathComponents": [
257 "Color",
258 "Green"
262 "accessLevel": "public",
263 "declarationFragments": [
265 "kind": "typeIdentifier",
266 "preciseIdentifier": "c:i",
267 "spelling": "unsigned int"
270 "kind": "text",
271 "spelling": " "
274 "kind": "identifier",
275 "spelling": "Blue"
278 "kind": "text",
279 "spelling": ";"
282 "identifier": {
283 "interfaceLanguage": "c",
284 "precise": "c:@S@Color@FI@Blue"
286 "kind": {
287 "displayName": "Instance Property",
288 "identifier": "c.property"
290 "location": {
291 "position": {
292 "character": 12,
293 "line": 5
295 "uri": "file://INPUT_DIR/input.h"
297 "names": {
298 "navigator": [
300 "kind": "identifier",
301 "spelling": "Blue"
304 "subHeading": [
306 "kind": "identifier",
307 "spelling": "Blue"
310 "title": "Blue"
312 "pathComponents": [
313 "Color",
314 "Blue"
318 "accessLevel": "public",
319 "declarationFragments": [
321 "kind": "typeIdentifier",
322 "preciseIdentifier": "c:i",
323 "spelling": "unsigned int"
326 "kind": "text",
327 "spelling": " "
330 "kind": "identifier",
331 "spelling": "Alpha"
334 "kind": "text",
335 "spelling": ";"
338 "docComment": {
339 "lines": [
341 "range": {
342 "end": {
343 "character": 37,
344 "line": 6
346 "start": {
347 "character": 7,
348 "line": 6
351 "text": "Alpha channel for transparency"
355 "identifier": {
356 "interfaceLanguage": "c",
357 "precise": "c:@S@Color@FI@Alpha"
359 "kind": {
360 "displayName": "Instance Property",
361 "identifier": "c.property"
363 "location": {
364 "position": {
365 "character": 12,
366 "line": 7
368 "uri": "file://INPUT_DIR/input.h"
370 "names": {
371 "navigator": [
373 "kind": "identifier",
374 "spelling": "Alpha"
377 "subHeading": [
379 "kind": "identifier",
380 "spelling": "Alpha"
383 "title": "Alpha"
385 "pathComponents": [
386 "Color",
387 "Alpha"