Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / clang / test / ExtractAPI / bool.c
blobfc013792c67991469f1029e95ec06c9ca99655d7
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
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 //--- input.h
14 #include <stdbool.h>
15 bool Foo;
17 bool IsFoo(bool Bar);
18 /// expected-no-diagnostics
20 //--- reference.output.json.in
22 "metadata": {
23 "formatVersion": {
24 "major": 0,
25 "minor": 5,
26 "patch": 3
28 "generator": "?"
30 "module": {
31 "name": "",
32 "platform": {
33 "architecture": "arm64",
34 "operatingSystem": {
35 "minimumVersion": {
36 "major": 11,
37 "minor": 0,
38 "patch": 0
40 "name": "macosx"
42 "vendor": "apple"
45 "relationships": [],
46 "symbols": [
48 "accessLevel": "public",
49 "declarationFragments": [
51 "kind": "typeIdentifier",
52 "preciseIdentifier": "c:b",
53 "spelling": "bool"
56 "kind": "text",
57 "spelling": " "
60 "kind": "identifier",
61 "spelling": "Foo"
64 "kind": "text",
65 "spelling": ";"
68 "identifier": {
69 "interfaceLanguage": "c",
70 "precise": "c:@Foo"
72 "kind": {
73 "displayName": "Global Variable",
74 "identifier": "c.var"
76 "location": {
77 "position": {
78 "character": 6,
79 "line": 2
81 "uri": "file://INPUT_DIR/input.h"
83 "names": {
84 "navigator": [
86 "kind": "identifier",
87 "spelling": "Foo"
90 "subHeading": [
92 "kind": "identifier",
93 "spelling": "Foo"
96 "title": "Foo"
98 "pathComponents": [
99 "Foo"
103 "accessLevel": "public",
104 "declarationFragments": [
106 "kind": "typeIdentifier",
107 "preciseIdentifier": "c:b",
108 "spelling": "bool"
111 "kind": "text",
112 "spelling": " "
115 "kind": "identifier",
116 "spelling": "IsFoo"
119 "kind": "text",
120 "spelling": "("
123 "kind": "typeIdentifier",
124 "preciseIdentifier": "c:b",
125 "spelling": "bool"
128 "kind": "text",
129 "spelling": " "
132 "kind": "internalParam",
133 "spelling": "Bar"
136 "kind": "text",
137 "spelling": ");"
140 "functionSignature": {
141 "parameters": [
143 "declarationFragments": [
145 "kind": "typeIdentifier",
146 "preciseIdentifier": "c:b",
147 "spelling": "bool"
150 "kind": "text",
151 "spelling": " "
154 "kind": "internalParam",
155 "spelling": "Bar"
158 "name": "Bar"
161 "returns": [
163 "kind": "typeIdentifier",
164 "preciseIdentifier": "c:b",
165 "spelling": "bool"
169 "identifier": {
170 "interfaceLanguage": "c",
171 "precise": "c:@F@IsFoo"
173 "kind": {
174 "displayName": "Function",
175 "identifier": "c.func"
177 "location": {
178 "position": {
179 "character": 6,
180 "line": 4
182 "uri": "file://INPUT_DIR/input.h"
184 "names": {
185 "navigator": [
187 "kind": "identifier",
188 "spelling": "IsFoo"
191 "subHeading": [
193 "kind": "identifier",
194 "spelling": "IsFoo"
197 "title": "IsFoo"
199 "pathComponents": [
200 "IsFoo"