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
14 // expected-no-diagnostics
21 struct _HiddenRecord
{
25 struct ExposedRecord
{
30 typedef struct {} _HiddenTypedef
;
31 typedef int ExposedTypedef
;
32 typedef _HiddenTypedef ExposedTypedefToHidden
;
35 #define _HIDDEN_MACRO 5
36 #define EXPOSED_MACRO 5
38 // Symbols that start with '_' should not appear in the reference output
39 //--- reference.output.json.in
52 "architecture": "arm64",
67 "source": "c:@S@ExposedRecord@FI@a",
68 "target": "c:@S@ExposedRecord",
69 "targetFallback": "ExposedRecord"
74 "accessLevel": "public",
75 "declarationFragments": [
77 "kind": "typeIdentifier",
78 "preciseIdentifier": "c:I",
87 "spelling": "exposed_global"
95 "interfaceLanguage": "c",
96 "precise": "c:@exposed_global"
99 "displayName": "Global Variable",
100 "identifier": "c.var"
107 "uri": "file://INPUT_DIR/input.h"
112 "kind": "identifier",
113 "spelling": "exposed_global"
118 "kind": "identifier",
119 "spelling": "exposed_global"
122 "title": "exposed_global"
129 "accessLevel": "public",
130 "declarationFragments": [
140 "kind": "identifier",
141 "spelling": "ExposedRecord"
149 "interfaceLanguage": "c",
150 "precise": "c:@S@ExposedRecord"
153 "displayName": "Structure",
154 "identifier": "c.struct"
161 "uri": "file://INPUT_DIR/input.h"
166 "kind": "identifier",
167 "spelling": "ExposedRecord"
172 "kind": "identifier",
173 "spelling": "ExposedRecord"
176 "title": "ExposedRecord"
183 "accessLevel": "public",
184 "declarationFragments": [
186 "kind": "typeIdentifier",
187 "preciseIdentifier": "c:I",
195 "kind": "identifier",
204 "interfaceLanguage": "c",
205 "precise": "c:@S@ExposedRecord@FI@a"
208 "displayName": "Instance Property",
209 "identifier": "c.property"
216 "uri": "file://INPUT_DIR/input.h"
221 "kind": "identifier",
227 "kind": "identifier",
239 "accessLevel": "public",
240 "declarationFragments": [
243 "spelling": "#define"
250 "kind": "identifier",
251 "spelling": "EXPOSED_MACRO"
255 "interfaceLanguage": "c",
256 "precise": "c:input.h@335@macro@EXPOSED_MACRO"
259 "displayName": "Macro",
260 "identifier": "c.macro"
267 "uri": "file://INPUT_DIR/input.h"
272 "kind": "identifier",
273 "spelling": "EXPOSED_MACRO"
278 "kind": "identifier",
279 "spelling": "EXPOSED_MACRO"
282 "title": "EXPOSED_MACRO"
289 "accessLevel": "public",
290 "declarationFragments": [
293 "spelling": "typedef"
300 "kind": "typeIdentifier",
301 "preciseIdentifier": "c:I",
309 "kind": "identifier",
310 "spelling": "ExposedTypedef"
318 "interfaceLanguage": "c",
319 "precise": "c:input.h@T@ExposedTypedef"
322 "displayName": "Type Alias",
323 "identifier": "c.typealias"
330 "uri": "file://INPUT_DIR/input.h"
335 "kind": "identifier",
336 "spelling": "ExposedTypedef"
341 "kind": "identifier",
342 "spelling": "ExposedTypedef"
345 "title": "ExposedTypedef"
353 "accessLevel": "public",
354 "declarationFragments": [
357 "spelling": "typedef"
364 "kind": "typeIdentifier",
365 "preciseIdentifier": "c:@SA@_HiddenTypedef",
366 "spelling": "_HiddenTypedef"
373 "kind": "identifier",
374 "spelling": "ExposedTypedefToHidden"
382 "interfaceLanguage": "c",
383 "precise": "c:input.h@T@ExposedTypedefToHidden"
386 "displayName": "Type Alias",
387 "identifier": "c.typealias"
394 "uri": "file://INPUT_DIR/input.h"
399 "kind": "identifier",
400 "spelling": "ExposedTypedefToHidden"
405 "kind": "identifier",
406 "spelling": "ExposedTypedefToHidden"
409 "title": "ExposedTypedefToHidden"
412 "ExposedTypedefToHidden"
414 "type": "c:@SA@_HiddenTypedef"