3 // RUN: split-file %s %t
4 // RUN: sed -e "s@INPUT_DIR@%{/t:regex_replacement}@g" \
5 // RUN: %t/reference.main.json.in >> %t/reference.main.json
6 // RUN: sed -e "s@INPUT_DIR@%{/t:regex_replacement}@g" \
7 // RUN: %t/reference.test.json.in >> %t/reference.test.json
8 // RUN: %clang_cc1 %t/test.c %t/main.c --emit-symbol-graph=%t/SymbolGraphs --product-name=multifile_test -triple=x86_64-apple-macosx12.0.0
11 // Generator version is not consistent across test runs, normalize it.
12 // RUN: sed -e "s@\"generator\": \".*\"@\"generator\": \"?\"@g" \
13 // RUN: %t/SymbolGraphs/main.json > %t/output-normalized.json
14 // RUN: diff %t/reference.main.json %t/output-normalized.json
17 // Generator version is not consistent across test runs, normalize it.
18 // RUN: sed -e "s@\"generator\": \".*\"@\"generator\": \"?\"@g" \
19 // RUN: %t/SymbolGraphs/test.json > %t/output-normalized.json
20 // RUN: diff %t/reference.test.json %t/output-normalized.json
23 // CHECK-NOT: warning:
29 #define testmarcro1 32
32 int testfunc (int param1
, int param2
);
39 int testfunc(int param1
, int param2
) { return param1
+ param2
; }
52 //--- reference.main.json.in
63 "name": "multifile_test",
65 "architecture": "x86_64",
75 "accessLevel": "public",
76 "declarationFragments": [
78 "kind": "typeIdentifier",
79 "preciseIdentifier": "c:I",
88 "spelling": "testfunc"
95 "kind": "typeIdentifier",
96 "preciseIdentifier": "c:I",
104 "kind": "internalParam",
112 "kind": "typeIdentifier",
113 "preciseIdentifier": "c:I",
121 "kind": "internalParam",
129 "functionSignature": {
132 "declarationFragments": [
134 "kind": "typeIdentifier",
135 "preciseIdentifier": "c:I",
143 "kind": "internalParam",
150 "declarationFragments": [
152 "kind": "typeIdentifier",
153 "preciseIdentifier": "c:I",
161 "kind": "internalParam",
170 "kind": "typeIdentifier",
171 "preciseIdentifier": "c:I",
177 "interfaceLanguage": "c",
178 "precise": "c:@F@testfunc"
181 "displayName": "Function",
182 "identifier": "c.func"
189 "uri": "file://INPUT_DIR/test.h"
194 "kind": "identifier",
195 "spelling": "testfunc"
200 "kind": "identifier",
201 "spelling": "testfunc"
211 "accessLevel": "public",
212 "declarationFragments": [
214 "kind": "typeIdentifier",
215 "preciseIdentifier": "c:v",
223 "kind": "identifier",
224 "spelling": "testfunc2"
231 "functionSignature": {
234 "kind": "typeIdentifier",
235 "preciseIdentifier": "c:v",
241 "interfaceLanguage": "c",
242 "precise": "c:@F@testfunc2"
245 "displayName": "Function",
246 "identifier": "c.func"
253 "uri": "file://INPUT_DIR/test.h"
258 "kind": "identifier",
259 "spelling": "testfunc2"
264 "kind": "identifier",
265 "spelling": "testfunc2"
275 "accessLevel": "public",
276 "declarationFragments": [
278 "kind": "typeIdentifier",
279 "preciseIdentifier": "c:I",
287 "kind": "identifier",
295 "functionSignature": {
298 "kind": "typeIdentifier",
299 "preciseIdentifier": "c:I",
305 "interfaceLanguage": "c",
306 "precise": "c:@F@main"
309 "displayName": "Function",
310 "identifier": "c.func"
317 "uri": "file://INPUT_DIR/main.c"
322 "kind": "identifier",
328 "kind": "identifier",
339 "accessLevel": "public",
340 "declarationFragments": [
343 "spelling": "#define"
350 "kind": "identifier",
351 "spelling": "testmarcro1"
355 "interfaceLanguage": "c",
356 "precise": "c:test.h@39@macro@testmarcro1"
359 "displayName": "Macro",
360 "identifier": "c.macro"
367 "uri": "file://INPUT_DIR/test.h"
372 "kind": "identifier",
373 "spelling": "testmarcro1"
378 "kind": "identifier",
379 "spelling": "testmarcro1"
382 "title": "testmarcro1"
389 "accessLevel": "public",
390 "declarationFragments": [
393 "spelling": "#define"
400 "kind": "identifier",
401 "spelling": "testmacro2"
405 "interfaceLanguage": "c",
406 "precise": "c:test.h@62@macro@testmacro2"
409 "displayName": "Macro",
410 "identifier": "c.macro"
417 "uri": "file://INPUT_DIR/test.h"
422 "kind": "identifier",
423 "spelling": "testmacro2"
428 "kind": "identifier",
429 "spelling": "testmacro2"
432 "title": "testmacro2"
440 //--- reference.test.json.in
451 "name": "multifile_test",
453 "architecture": "x86_64",
463 "accessLevel": "public",
464 "declarationFragments": [
466 "kind": "typeIdentifier",
467 "preciseIdentifier": "c:I",
475 "kind": "identifier",
476 "spelling": "testfunc"
483 "kind": "typeIdentifier",
484 "preciseIdentifier": "c:I",
492 "kind": "internalParam",
500 "kind": "typeIdentifier",
501 "preciseIdentifier": "c:I",
509 "kind": "internalParam",
517 "functionSignature": {
520 "declarationFragments": [
522 "kind": "typeIdentifier",
523 "preciseIdentifier": "c:I",
531 "kind": "internalParam",
538 "declarationFragments": [
540 "kind": "typeIdentifier",
541 "preciseIdentifier": "c:I",
549 "kind": "internalParam",
558 "kind": "typeIdentifier",
559 "preciseIdentifier": "c:I",
565 "interfaceLanguage": "c",
566 "precise": "c:@F@testfunc"
569 "displayName": "Function",
570 "identifier": "c.func"
577 "uri": "file://INPUT_DIR/test.h"
582 "kind": "identifier",
583 "spelling": "testfunc"
588 "kind": "identifier",
589 "spelling": "testfunc"
599 "accessLevel": "public",
600 "declarationFragments": [
602 "kind": "typeIdentifier",
603 "preciseIdentifier": "c:v",
611 "kind": "identifier",
612 "spelling": "testfunc2"
619 "functionSignature": {
622 "kind": "typeIdentifier",
623 "preciseIdentifier": "c:v",
629 "interfaceLanguage": "c",
630 "precise": "c:@F@testfunc2"
633 "displayName": "Function",
634 "identifier": "c.func"
641 "uri": "file://INPUT_DIR/test.h"
646 "kind": "identifier",
647 "spelling": "testfunc2"
652 "kind": "identifier",
653 "spelling": "testfunc2"
663 "accessLevel": "public",
664 "declarationFragments": [
667 "spelling": "#define"
674 "kind": "identifier",
675 "spelling": "testmarcro1"
679 "interfaceLanguage": "c",
680 "precise": "c:test.h@39@macro@testmarcro1"
683 "displayName": "Macro",
684 "identifier": "c.macro"
691 "uri": "file://INPUT_DIR/test.h"
696 "kind": "identifier",
697 "spelling": "testmarcro1"
702 "kind": "identifier",
703 "spelling": "testmarcro1"
706 "title": "testmarcro1"
713 "accessLevel": "public",
714 "declarationFragments": [
717 "spelling": "#define"
724 "kind": "identifier",
725 "spelling": "testmacro2"
729 "interfaceLanguage": "c",
730 "precise": "c:test.h@62@macro@testmacro2"
733 "displayName": "Macro",
734 "identifier": "c.macro"
741 "uri": "file://INPUT_DIR/test.h"
746 "kind": "identifier",
747 "spelling": "testmacro2"
752 "kind": "identifier",
753 "spelling": "testmacro2"
756 "title": "testmacro2"