[LV] Add test showing debug output for loops with uncountable BTCs.
[llvm-project.git] / clang / test / ExtractAPI / function_noexcepts.cpp
blobfc18ecb04fefd012b3c8e85c9229660040c2cdad
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_cc1 -extract-api --pretty-sgf -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
13 //--- input.h
14 void getFoo() noexcept;
16 void getBar() noexcept(true);
18 void getFooBar() noexcept(false);
19 /// expected-no-diagnostics
21 //--- reference.output.json.in
23 "metadata": {
24 "formatVersion": {
25 "major": 0,
26 "minor": 5,
27 "patch": 3
29 "generator": "?"
31 "module": {
32 "name": "",
33 "platform": {
34 "architecture": "arm64",
35 "operatingSystem": {
36 "minimumVersion": {
37 "major": 11,
38 "minor": 0,
39 "patch": 0
41 "name": "macosx"
43 "vendor": "apple"
46 "relationships": [],
47 "symbols": [
49 "accessLevel": "public",
50 "declarationFragments": [
52 "kind": "typeIdentifier",
53 "preciseIdentifier": "c:v",
54 "spelling": "void"
57 "kind": "text",
58 "spelling": " "
61 "kind": "identifier",
62 "spelling": "getFoo"
65 "kind": "text",
66 "spelling": "() "
69 "kind": "keyword",
70 "spelling": "noexcept"
73 "kind": "text",
74 "spelling": ";"
77 "functionSignature": {
78 "returns": [
80 "kind": "typeIdentifier",
81 "preciseIdentifier": "c:v",
82 "spelling": "void"
86 "identifier": {
87 "interfaceLanguage": "c++",
88 "precise": "c:@F@getFoo#"
90 "kind": {
91 "displayName": "Function",
92 "identifier": "c++.func"
94 "location": {
95 "position": {
96 "character": 5,
97 "line": 0
99 "uri": "file://INPUT_DIR/input.h"
101 "names": {
102 "navigator": [
104 "kind": "identifier",
105 "spelling": "getFoo"
108 "subHeading": [
110 "kind": "identifier",
111 "spelling": "getFoo"
114 "title": "getFoo"
116 "pathComponents": [
117 "getFoo"
121 "accessLevel": "public",
122 "declarationFragments": [
124 "kind": "typeIdentifier",
125 "preciseIdentifier": "c:v",
126 "spelling": "void"
129 "kind": "text",
130 "spelling": " "
133 "kind": "identifier",
134 "spelling": "getBar"
137 "kind": "text",
138 "spelling": "() "
141 "kind": "keyword",
142 "spelling": "noexcept"
145 "kind": "text",
146 "spelling": "("
149 "kind": "keyword",
150 "spelling": "true"
153 "kind": "text",
154 "spelling": ");"
157 "functionSignature": {
158 "returns": [
160 "kind": "typeIdentifier",
161 "preciseIdentifier": "c:v",
162 "spelling": "void"
166 "identifier": {
167 "interfaceLanguage": "c++",
168 "precise": "c:@F@getBar#"
170 "kind": {
171 "displayName": "Function",
172 "identifier": "c++.func"
174 "location": {
175 "position": {
176 "character": 5,
177 "line": 2
179 "uri": "file://INPUT_DIR/input.h"
181 "names": {
182 "navigator": [
184 "kind": "identifier",
185 "spelling": "getBar"
188 "subHeading": [
190 "kind": "identifier",
191 "spelling": "getBar"
194 "title": "getBar"
196 "pathComponents": [
197 "getBar"
201 "accessLevel": "public",
202 "declarationFragments": [
204 "kind": "typeIdentifier",
205 "preciseIdentifier": "c:v",
206 "spelling": "void"
209 "kind": "text",
210 "spelling": " "
213 "kind": "identifier",
214 "spelling": "getFooBar"
217 "kind": "text",
218 "spelling": "() "
221 "kind": "keyword",
222 "spelling": "noexcept"
225 "kind": "text",
226 "spelling": "("
229 "kind": "keyword",
230 "spelling": "false"
233 "kind": "text",
234 "spelling": ");"
237 "functionSignature": {
238 "returns": [
240 "kind": "typeIdentifier",
241 "preciseIdentifier": "c:v",
242 "spelling": "void"
246 "identifier": {
247 "interfaceLanguage": "c++",
248 "precise": "c:@F@getFooBar#"
250 "kind": {
251 "displayName": "Function",
252 "identifier": "c++.func"
254 "location": {
255 "position": {
256 "character": 5,
257 "line": 4
259 "uri": "file://INPUT_DIR/input.h"
261 "names": {
262 "navigator": [
264 "kind": "identifier",
265 "spelling": "getFooBar"
268 "subHeading": [
270 "kind": "identifier",
271 "spelling": "getFooBar"
274 "title": "getFooBar"
276 "pathComponents": [
277 "getFooBar"