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 --pretty-sgf \
9 // RUN: --symbol-graph-dir=%t/SymbolGraphs --product-name=multifile_test -triple=x86_64-apple-macosx12.0.0
12 // Generator version is not consistent across test runs, normalize it.
13 // RUN: sed -e "s@\"generator\": \".*\"@\"generator\": \"?\"@g" \
14 // RUN: %t/SymbolGraphs/main.c.symbols.json > %t/output-normalized.json
15 // RUN: diff %t/reference.main.json %t/output-normalized.json
18 // Generator version is not consistent across test runs, normalize it.
19 // RUN: sed -e "s@\"generator\": \".*\"@\"generator\": \"?\"@g" \
20 // RUN: %t/SymbolGraphs/test.c.symbols.json > %t/output-normalized.json
21 // RUN: diff %t/reference.test.json %t/output-normalized.json
24 // CHECK-NOT: warning:
30 int testfunc (int param1
, int param2
);
37 int testfunc(int param1
, int param2
) { return param1
+ param2
; }
50 //--- reference.main.json.in
61 "name": "multifile_test",
63 "architecture": "x86_64",
73 "accessLevel": "public",
74 "declarationFragments": [
76 "kind": "typeIdentifier",
77 "preciseIdentifier": "c:I",
86 "spelling": "testfunc"
93 "kind": "typeIdentifier",
94 "preciseIdentifier": "c:I",
102 "kind": "internalParam",
110 "kind": "typeIdentifier",
111 "preciseIdentifier": "c:I",
119 "kind": "internalParam",
127 "functionSignature": {
130 "declarationFragments": [
132 "kind": "typeIdentifier",
133 "preciseIdentifier": "c:I",
141 "kind": "internalParam",
148 "declarationFragments": [
150 "kind": "typeIdentifier",
151 "preciseIdentifier": "c:I",
159 "kind": "internalParam",
168 "kind": "typeIdentifier",
169 "preciseIdentifier": "c:I",
175 "interfaceLanguage": "c",
176 "precise": "c:@F@testfunc"
179 "displayName": "Function",
180 "identifier": "c.func"
187 "uri": "file://INPUT_DIR/test.h"
192 "kind": "identifier",
193 "spelling": "testfunc"
198 "kind": "identifier",
199 "spelling": "testfunc"
209 "accessLevel": "public",
210 "declarationFragments": [
212 "kind": "typeIdentifier",
213 "preciseIdentifier": "c:v",
221 "kind": "identifier",
222 "spelling": "testfunc2"
229 "functionSignature": {
232 "kind": "typeIdentifier",
233 "preciseIdentifier": "c:v",
239 "interfaceLanguage": "c",
240 "precise": "c:@F@testfunc2"
243 "displayName": "Function",
244 "identifier": "c.func"
251 "uri": "file://INPUT_DIR/test.h"
256 "kind": "identifier",
257 "spelling": "testfunc2"
262 "kind": "identifier",
263 "spelling": "testfunc2"
273 "accessLevel": "public",
274 "declarationFragments": [
276 "kind": "typeIdentifier",
277 "preciseIdentifier": "c:I",
285 "kind": "identifier",
293 "functionSignature": {
296 "kind": "typeIdentifier",
297 "preciseIdentifier": "c:I",
303 "interfaceLanguage": "c",
304 "precise": "c:@F@main"
307 "displayName": "Function",
308 "identifier": "c.func"
315 "uri": "file://INPUT_DIR/main.c"
320 "kind": "identifier",
326 "kind": "identifier",
338 //--- reference.test.json.in
349 "name": "multifile_test",
351 "architecture": "x86_64",
361 "accessLevel": "public",
362 "declarationFragments": [
364 "kind": "typeIdentifier",
365 "preciseIdentifier": "c:I",
373 "kind": "identifier",
374 "spelling": "testfunc"
381 "kind": "typeIdentifier",
382 "preciseIdentifier": "c:I",
390 "kind": "internalParam",
398 "kind": "typeIdentifier",
399 "preciseIdentifier": "c:I",
407 "kind": "internalParam",
415 "functionSignature": {
418 "declarationFragments": [
420 "kind": "typeIdentifier",
421 "preciseIdentifier": "c:I",
429 "kind": "internalParam",
436 "declarationFragments": [
438 "kind": "typeIdentifier",
439 "preciseIdentifier": "c:I",
447 "kind": "internalParam",
456 "kind": "typeIdentifier",
457 "preciseIdentifier": "c:I",
463 "interfaceLanguage": "c",
464 "precise": "c:@F@testfunc"
467 "displayName": "Function",
468 "identifier": "c.func"
475 "uri": "file://INPUT_DIR/test.h"
480 "kind": "identifier",
481 "spelling": "testfunc"
486 "kind": "identifier",
487 "spelling": "testfunc"
497 "accessLevel": "public",
498 "declarationFragments": [
500 "kind": "typeIdentifier",
501 "preciseIdentifier": "c:v",
509 "kind": "identifier",
510 "spelling": "testfunc2"
517 "functionSignature": {
520 "kind": "typeIdentifier",
521 "preciseIdentifier": "c:v",
527 "interfaceLanguage": "c",
528 "precise": "c:@F@testfunc2"
531 "displayName": "Function",
532 "identifier": "c.func"
539 "uri": "file://INPUT_DIR/test.h"
544 "kind": "identifier",
545 "spelling": "testfunc2"
550 "kind": "identifier",
551 "spelling": "testfunc2"