[OptTable] Fix typo VALUE => VALUES (NFCI) (#121523)
[llvm-project.git] / clang / test / ExtractAPI / emit-symbol-graph / single_file.c
blobfeb759f5947bc9f63360dabffe1cf12662451c5f
1 // RUN: rm -rf %t
2 // RUN: mkdir %t
3 // RUN: split-file %s %t
4 // RUN: sed -e "s@INPUT_DIR@%{/t:regex_replacement}@g" \
5 // RUN: %t/reference.output.json.in >> %t/reference.output.json
6 // RUN: %clang_cc1 %t/main.c -emit-symbol-graph --pretty-sgf \
7 // RUN: --symbol-graph-dir=%t/SymbolGraphs --product-name=basicfile -triple=x86_64-apple-macosx12.0.0
9 // Generator version is not consistent across test runs, normalize it.
10 // RUN: sed -e "s@\"generator\": \".*\"@\"generator\": \"?\"@g" \
11 // RUN: %t/SymbolGraphs/main.c.symbols.json >> %t/output-normalized.json
12 // RUN: diff %t/reference.output.json %t/output-normalized.json
14 // CHECK-NOT: error:
15 // CHECK-NOT: warning:
17 //--- main.c
18 int main ()
20 return 0;
24 //--- reference.output.json.in
26 "metadata": {
27 "formatVersion": {
28 "major": 0,
29 "minor": 5,
30 "patch": 3
32 "generator": "?"
34 "module": {
35 "name": "basicfile",
36 "platform": {
37 "architecture": "x86_64",
38 "operatingSystem": {
39 "name": "macosx"
41 "vendor": "apple"
44 "relationships": [],
45 "symbols": [
47 "accessLevel": "public",
48 "declarationFragments": [
50 "kind": "typeIdentifier",
51 "preciseIdentifier": "c:I",
52 "spelling": "int"
55 "kind": "text",
56 "spelling": " "
59 "kind": "identifier",
60 "spelling": "main"
63 "kind": "text",
64 "spelling": "();"
67 "functionSignature": {
68 "returns": [
70 "kind": "typeIdentifier",
71 "preciseIdentifier": "c:I",
72 "spelling": "int"
76 "identifier": {
77 "interfaceLanguage": "c",
78 "precise": "c:@F@main"
80 "kind": {
81 "displayName": "Function",
82 "identifier": "c.func"
84 "location": {
85 "position": {
86 "character": 4,
87 "line": 0
89 "uri": "file://INPUT_DIR/main.c"
91 "names": {
92 "navigator": [
94 "kind": "identifier",
95 "spelling": "main"
98 "subHeading": [
100 "kind": "identifier",
101 "spelling": "main"
104 "title": "main"
106 "pathComponents": [
107 "main"