- Notifications
You must be signed in to change notification settings - Fork 10.5k
/
Copy pathcoverage_errors_exec.swift
442 lines (385 loc) · 23.5 KB
/
coverage_errors_exec.swift
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
// RUN: %empty-directory(%t)
// RUN: %target-build-swift %s -profile-generate -profile-coverage-mapping -o %t/main
// RUN: %target-codesign %t/main
// RUN: env %env-LLVM_PROFILE_FILE=%t/default.profraw %target-run %t/main
// RUN: %llvm-profdata merge %t/default.profraw -o %t/default.profdata
// RUN: %llvm-cov show %t/main -instr-profile=%t/default.profdata | %FileCheck %s
// REQUIRES: profile_runtime
// REQUIRES: executable_test
structErr:Error{}
structS{
static subscript()->Int{
get throws{throwErr()}
}
func throwingMethod()throws->Int{throwErr()}
}
func noThrowingFn()throws->Int{0}
@discardableResult
func throwingFn()throws->Int{throwErr()}
func throwingBool()throws->Bool{throwErr()}
func noThrowingBool()throws->Bool{true}
varthrowingProp:Int{
get throws{throwErr()}
}
varthrowingS:S{
get throws{throwErr()}
}
varnoThrowingS:S{
get throws{S()}
}
func test1()->Int{ // CHECK: {{ *}}[[@LINE]]|{{ *}}1
do{ // CHECK: {{ *}}[[@LINE]]|{{ *}}1
letx=trythrowingFn() // CHECK: {{ *}}[[@LINE]]|{{ *}}1
return x // CHECK: {{ *}}[[@LINE]]|{{ *}}0
}catch{ // CHECK: {{ *}}[[@LINE]]|{{ *}}1
return0 // CHECK: {{ *}}[[@LINE]]|{{ *}}1
} // CHECK: {{ *}}[[@LINE]]|{{ *}}1
} // CHECK: {{ *}}[[@LINE]]|{{ *}}1
_ =test1() // CHECK: {{ *}}[[@LINE]]|{{ *}}1
func test2()throws->Int{ // CHECK: {{ *}}[[@LINE]]|{{ *}}1
letx=trythrowingFn() // CHECK: {{ *}}[[@LINE]]|{{ *}}1
return x // CHECK: {{ *}}[[@LINE]]|{{ *}}0
} // CHECK: {{ *}}[[@LINE]]|{{ *}}1
_ =try?test2() // CHECK: {{ *}}[[@LINE]]|{{ *}}1
func test3()throws->Int{ // CHECK: {{ *}}[[@LINE]]|{{ *}}1
letx=try throwingProp // CHECK: {{ *}}[[@LINE]]|{{ *}}1
return x // CHECK: {{ *}}[[@LINE]]|{{ *}}0
} // CHECK: {{ *}}[[@LINE]]|{{ *}}1
_ =try?test3() // CHECK: {{ *}}[[@LINE]]|{{ *}}1
func test4()throws->Int{ // CHECK: {{ *}}[[@LINE]]|{{ *}}1
letx=tryS[] // CHECK: {{ *}}[[@LINE]]|{{ *}}1
return x // CHECK: {{ *}}[[@LINE]]|{{ *}}0
} // CHECK: {{ *}}[[@LINE]]|{{ *}}1
_ =try?test4() // CHECK: {{ *}}[[@LINE]]|{{ *}}1
// Note we don't emit a region after the call since it would be empty.
func test5()->Int{ // CHECK: {{ *}}[[@LINE]]|{{ *}}1
do{ // CHECK: {{ *}}[[@LINE]]|{{ *}}1
returntrythrowingFn() // CHECK: {{ *}}[[@LINE]]|{{ *}}1
}catch{ // CHECK: {{ *}}[[@LINE]]|{{ *}}1
return0 // CHECK: {{ *}}[[@LINE]]|{{ *}}1
} // CHECK: {{ *}}[[@LINE]]|{{ *}}1
} // CHECK: {{ *}}[[@LINE]]|{{ *}}1
_ =test5() // CHECK: {{ *}}[[@LINE]]|{{ *}}1
func takesInts(_ x:Int, _ y:Int){} // CHECK: {{ *}}[[@LINE]]|{{ *}}0
// The throwing expr is nested here, the region starts after the throwing expr.
func test6()throws{ // CHECK: {{ *}}[[@LINE]]|{{ *}}1
takesInts(trythrowingFn(),0) // CHECK: {{ *}}[[@LINE]]|{{ *}}1
} // CHECK: {{ *}}[[@LINE]]|{{ *}}0
try?test6() // CHECK: {{ *}}[[@LINE]]|{{ *}}1
func test7()throws{ // CHECK: {{ *}}[[@LINE]]|{{ *}}1
takesInts( // CHECK: {{ *}}[[@LINE]]|{{ *}}1
trythrowingFn(), // CHECK: {{ *}}[[@LINE]]|{{ *}}1
0 // CHECK: {{ *}}[[@LINE]]|{{ *}}0
) // CHECK: {{ *}}[[@LINE]]|{{ *}}0
} // CHECK: {{ *}}[[@LINE]]|{{ *}}0
try?test7() // CHECK: {{ *}}[[@LINE]]|{{ *}}1
func test8()throws->Int{ // CHECK: {{ *}}[[@LINE]]|{{ *}}1
letx=try throwingS.throwingMethod() // CHECK: {{ *}}[[@LINE]]|{{ *}}1
return x // CHECK: {{ *}}[[@LINE]]|{{ *}}0
} // CHECK: {{ *}}[[@LINE]]|{{ *}}1
_ =try?test8()
func test9()throws->Int{ // CHECK: {{ *}}[[@LINE]]|{{ *}}1
letx=try noThrowingS.throwingMethod() // CHECK: {{ *}}[[@LINE]]|{{ *}}1
return x // CHECK: {{ *}}[[@LINE]]|{{ *}}0
} // CHECK: {{ *}}[[@LINE]]|{{ *}}1
_ =try?test9() // CHECK: {{ *}}[[@LINE]]|{{ *}}1
func test10()throws{ // CHECK: {{ *}}[[@LINE]]|{{ *}}1
takesInts( // CHECK: {{ *}}[[@LINE]]|{{ *}}1
trythrowingFn(), // CHECK: {{ *}}[[@LINE]]|{{ *}}1
trythrowingFn() // CHECK: {{ *}}[[@LINE]]|{{ *}}0
) // CHECK: {{ *}}[[@LINE]]|{{ *}}0
} // CHECK: {{ *}}[[@LINE]]|{{ *}}0
try?test10() // CHECK: {{ *}}[[@LINE]]|{{ *}}1
func test11()throws{ // CHECK: {{ *}}[[@LINE]]|{{ *}}1
takesInts( // CHECK: {{ *}}[[@LINE]]|{{ *}}1
trynoThrowingFn(), // CHECK: {{ *}}[[@LINE]]|{{ *}}1
trythrowingFn() // CHECK: {{ *}}[[@LINE]]|{{ *}}1
) // CHECK: {{ *}}[[@LINE]]|{{ *}}0
} // CHECK: {{ *}}[[@LINE]]|{{ *}}0
try?test11() // CHECK: {{ *}}[[@LINE]]|{{ *}}1
// rdar://100470244 - Make sure we don't underflow the counter here.
func test12()->Int{ // CHECK: {{ *}}[[@LINE]]|{{ *}}1
do{ // CHECK: {{ *}}[[@LINE]]|{{ *}}1
trythrowingFn() // CHECK: {{ *}}[[@LINE]]|{{ *}}1
return1 // CHECK: {{ *}}[[@LINE]]|{{ *}}0
}catch{ // CHECK: {{ *}}[[@LINE]]|{{ *}}1
return2 // CHECK: {{ *}}[[@LINE]]|{{ *}}1
} // CHECK: {{ *}}[[@LINE]]|{{ *}}1
} // CHECK: {{ *}}[[@LINE]]|{{ *}}1
_ =test12() // CHECK: {{ *}}[[@LINE]]|{{ *}}1
func test13()throws->Int{ // CHECK: {{ *}}[[@LINE]]|{{ *}}1
x:do{ // CHECK: {{ *}}[[@LINE]]|{{ *}}1
trythrowingFn() // CHECK: {{ *}}[[@LINE]]|{{ *}}1
}catch is Err{ // CHECK: {{ *}}[[@LINE]]|{{ *}}1
break x // CHECK: {{ *}}[[@LINE]]|{{ *}}1
} // CHECK: {{ *}}[[@LINE]]|{{ *}}1
return1 // CHECK: {{ *}}[[@LINE]]|{{ *}}1
} // CHECK: {{ *}}[[@LINE]]|{{ *}}1
_ =try?test13() // CHECK: {{ *}}[[@LINE]]|{{ *}}1
func test14()throws->Int{ // CHECK: {{ *}}[[@LINE]]|{{ *}}1
x:do{ // CHECK: {{ *}}[[@LINE]]|{{ *}}1
do{ // CHECK: {{ *}}[[@LINE]]|{{ *}}1
trythrowingFn() // CHECK: {{ *}}[[@LINE]]|{{ *}}1
break x // CHECK: {{ *}}[[@LINE]]|{{ *}}0
}catch is Err{ // CHECK: {{ *}}[[@LINE]]|{{ *}}1
} // CHECK: {{ *}}[[@LINE]]|{{ *}}1
return1 // CHECK: {{ *}}[[@LINE]]|{{ *}}1
}catch is Err{ // CHECK: {{ *}}[[@LINE]]|{{ *}}1
} // CHECK: {{ *}}[[@LINE]]|{{ *}}0
return2 // CHECK: {{ *}}[[@LINE]]|{{ *}}0
} // CHECK: {{ *}}[[@LINE]]|{{ *}}1
_ =try?test14() // CHECK: {{ *}}[[@LINE]]|{{ *}}1
func test15()throws->Int{ // CHECK: {{ *}}[[@LINE]]|{{ *}}1
x:do{ // CHECK: {{ *}}[[@LINE]]|{{ *}}1
do{ // CHECK: {{ *}}[[@LINE]]|{{ *}}1
trynoThrowingFn() // CHECK: {{ *}}[[@LINE]]|{{ *}}1
break x // CHECK: {{ *}}[[@LINE]]|{{ *}}1
}catch is Err{ // CHECK: {{ *}}[[@LINE]]|{{ *}}1
} // CHECK: {{ *}}[[@LINE]]|{{ *}}0
return1 // CHECK: {{ *}}[[@LINE]]|{{ *}}0
}catch is Err{ // CHECK: {{ *}}[[@LINE]]|{{ *}}1
// CHECK: {{ *}}[[@LINE]]|{{ *}}0
} // CHECK: {{ *}}[[@LINE]]|{{ *}}1
return2 // CHECK: {{ *}}[[@LINE]]|{{ *}}1
} // CHECK: {{ *}}[[@LINE]]|{{ *}}1
_ =try?test15() // CHECK: {{ *}}[[@LINE]]|{{ *}}1
func test16()throws->Int{ // CHECK: {{ *}}[[@LINE]]|{{ *}}1
letx=trytrue // CHECK: {{ *}}[[@LINE]]|{{ *}}1
?throwingFn() // CHECK: {{ *}}[[@LINE]]|{{ *}}1
:throwingFn() // CHECK: {{ *}}[[@LINE]]|{{ *}}0
return x // CHECK: {{ *}}[[@LINE]]|{{ *}}0
} // CHECK: {{ *}}[[@LINE]]|{{ *}}1
_ =try?test16() // CHECK: {{ *}}[[@LINE]]|{{ *}}1
// FIXME: The line execution count is misleading here as it includes the
// trailing edge of the thrown error from the first branch (rdar://118654503).
func test17()throws->Int{ // CHECK: {{ *}}[[@LINE]]|{{ *}}1
letx=tryfalse // CHECK: {{ *}}[[@LINE]]|{{ *}}1
?throwingFn() // CHECK: {{ *}}[[@LINE]]|{{ *}}1
:throwingFn() // CHECK: {{ *}}[[@LINE]]|{{ *}}1
return x // CHECK: {{ *}}[[@LINE]]|{{ *}}0
} // CHECK: {{ *}}[[@LINE]]|{{ *}}1
_ =try?test17() // CHECK: {{ *}}[[@LINE]]|{{ *}}1
// FIXME: The line execution count is misleading here as it includes the
// trailing edge of the thrown error from the first branch (rdar://118654503).
func test18()throws->Int{ // CHECK: {{ *}}[[@LINE]]|{{ *}}1
letx=trytrue // CHECK: {{ *}}[[@LINE]]|{{ *}}1
?noThrowingFn() // CHECK: {{ *}}[[@LINE]]|{{ *}}1
:noThrowingFn() // CHECK: {{ *}}[[@LINE]]|{{ *}}1
return x // CHECK: {{ *}}[[@LINE]]|{{ *}}1
} // CHECK: {{ *}}[[@LINE]]|{{ *}}1
_ =try?test18() // CHECK: {{ *}}[[@LINE]]|{{ *}}1
@discardableResult
func takesOptInts(_ x:Int?, _ y:Int?)->Int{0}
func test19(){ // CHECK: {{ *}}[[@LINE]]|{{ *}}1
takesOptInts( // CHECK: {{ *}}[[@LINE]]|{{ *}}1
try?throwingFn(), // CHECK: {{ *}}[[@LINE]]|{{ *}}1
try?throwingFn() // CHECK: {{ *}}[[@LINE]]|{{ *}}1
) // CHECK: {{ *}}[[@LINE]]|{{ *}}1
} // CHECK: {{ *}}[[@LINE]]|{{ *}}1
test19() // CHECK: {{ *}}[[@LINE]]|{{ *}}1
func test20(
)throws->Int{ // CHECK: {{ *}}[[@LINE]]|{{ *}}1
trytakesOptInts( // CHECK: {{ *}}[[@LINE]]|{{ *}}1
throwingFn(), // CHECK: {{ *}}[[@LINE]]|{{ *}}1
try?throwingFn() // CHECK: {{ *}}[[@LINE]]|{{ *}}0
) // CHECK: {{ *}}[[@LINE]]|{{ *}}0
} // CHECK: {{ *}}[[@LINE]]|{{ *}}0
_ =try?test20() // CHECK: {{ *}}[[@LINE]]|{{ *}}1
func test21()throws->Int{ // CHECK: {{ *}}[[@LINE]]|{{ *}}1
try{ // CHECK: {{ *}}[[@LINE]]|{{ *}}1
throwErr() // CHECK: {{ *}}[[@LINE]]|{{ *}}1
}() // CHECK: {{ *}}[[@LINE]]|{{ *}}1
return1 // CHECK: {{ *}}[[@LINE]]|{{ *}}0
} // CHECK: {{ *}}[[@LINE]]|{{ *}}1
_ =try?test21() // CHECK: {{ *}}[[@LINE]]|{{ *}}1
func test22(
)throws->Int{ // CHECK: {{ *}}[[@LINE]]|{{ *}}1
trytakesOptInts( // CHECK: {{ *}}[[@LINE]]|{{ *}}1
noThrowingFn(), // CHECK: {{ *}}[[@LINE]]|{{ *}}1
try?throwingFn() // CHECK: {{ *}}[[@LINE]]|{{ *}}1
) // CHECK: {{ *}}[[@LINE]]|{{ *}}1
} // CHECK: {{ *}}[[@LINE]]|{{ *}}1
_ =try?test22() // CHECK: {{ *}}[[@LINE]]|{{ *}}1
func test23()->Int?{ // CHECK: {{ *}}[[@LINE]]|{{ *}}1
guardlet x =try?throwingFn()else{ // CHECK: {{ *}}[[@LINE]]|{{ *}}1
returnnil // CHECK: {{ *}}[[@LINE]]|{{ *}}1
} // CHECK: {{ *}}[[@LINE]]|{{ *}}1
return x // CHECK: {{ *}}[[@LINE]]|{{ *}}0
} // CHECK: {{ *}}[[@LINE]]|{{ *}}1
_ =test23() // CHECK: {{ *}}[[@LINE]]|{{ *}}1
func test24()->Int?{ // CHECK: {{ *}}[[@LINE]]|{{ *}}1
guardlet x =try?noThrowingFn()else{ // CHECK: {{ *}}[[@LINE]]|{{ *}}1
returnnil // CHECK: {{ *}}[[@LINE]]|{{ *}}0
} // CHECK: {{ *}}[[@LINE]]|{{ *}}1
return x // CHECK: {{ *}}[[@LINE]]|{{ *}}1
} // CHECK: {{ *}}[[@LINE]]|{{ *}}1
_ =test24() // CHECK: {{ *}}[[@LINE]]|{{ *}}1
func test25()->Int{ // CHECK: {{ *}}[[@LINE]]|{{ *}}1
letx=try!noThrowingFn() // CHECK: {{ *}}[[@LINE]]|{{ *}}1
return x // CHECK: {{ *}}[[@LINE]]|{{ *}}1
} // CHECK: {{ *}}[[@LINE]]|{{ *}}1
_ =test25() // CHECK: {{ *}}[[@LINE]]|{{ *}}1
func test26()throws->Int{
letx=iftrythrowingBool(){ // CHECK: {{ *}}[[@LINE]]|{{ *}}1
trythrowingFn() // CHECK: {{ *}}[[@LINE]]|{{ *}}0
}else{ // CHECK: {{ *}}[[@LINE]]|{{ *}}0
trythrowingFn() // CHECK: {{ *}}[[@LINE]]|{{ *}}0
} // CHECK: {{ *}}[[@LINE]]|{{ *}}0
return x // CHECK: {{ *}}[[@LINE]]|{{ *}}0
} // CHECK: {{ *}}[[@LINE]]|{{ *}}1
_ =try?test26() // CHECK: {{ *}}[[@LINE]]|{{ *}}1
func test27()throws->Int{
letx=iftrynoThrowingBool(){ // CHECK: {{ *}}[[@LINE]]|{{ *}}1
trythrowingFn() // CHECK: {{ *}}[[@LINE]]|{{ *}}1
}else{ // CHECK: {{ *}}[[@LINE]]|{{ *}}0
trythrowingFn() // CHECK: {{ *}}[[@LINE]]|{{ *}}0
} // CHECK: {{ *}}[[@LINE]]|{{ *}}0
return x // CHECK: {{ *}}[[@LINE]]|{{ *}}0
} // CHECK: {{ *}}[[@LINE]]|{{ *}}1
_ =try?test27() // CHECK: {{ *}}[[@LINE]]|{{ *}}1
func test28()throws->Int{
letx=iftry!noThrowingBool(){ // CHECK: {{ *}}[[@LINE]]|{{ *}}1
trythrowingFn() // CHECK: {{ *}}[[@LINE]]|{{ *}}0
}else{ // CHECK: {{ *}}[[@LINE]]|{{ *}}1
trythrowingFn() // CHECK: {{ *}}[[@LINE]]|{{ *}}1
} // CHECK: {{ *}}[[@LINE]]|{{ *}}0
return x // CHECK: {{ *}}[[@LINE]]|{{ *}}0
} // CHECK: {{ *}}[[@LINE]]|{{ *}}1
_ =try?test28() // CHECK: {{ *}}[[@LINE]]|{{ *}}1
func test29()throws->Int{ // CHECK: {{ *}}[[@LINE]]|{{ *}}1
trythrowingBool() // CHECK: {{ *}}[[@LINE]]|{{ *}}1
?trythrowingFn() // CHECK: {{ *}}[[@LINE]]|{{ *}}0
:trythrowingFn() // CHECK: {{ *}}[[@LINE]]|{{ *}}0
} // CHECK: {{ *}}[[@LINE]]|{{ *}}0
_ =try?test29() // CHECK: {{ *}}[[@LINE]]|{{ *}}1
func test30()throws->Int{ // CHECK: {{ *}}[[@LINE]]|{{ *}}1
trynoThrowingBool() // CHECK: {{ *}}[[@LINE]]|{{ *}}1
?trythrowingFn() // CHECK: {{ *}}[[@LINE]]|{{ *}}1
:trythrowingFn() // CHECK: {{ *}}[[@LINE]]|{{ *}}0
} // CHECK: {{ *}}[[@LINE]]|{{ *}}0
_ =try?test30() // CHECK: {{ *}}[[@LINE]]|{{ *}}1
// FIXME: The line execution count is misleading here (rdar://118654503).
func test31()throws->Int{ // CHECK: {{ *}}[[@LINE]]|{{ *}}1
try!noThrowingBool() // CHECK: {{ *}}[[@LINE]]|{{ *}}1
?trythrowingFn() // CHECK: {{ *}}[[@LINE]]|{{ *}}1
:trythrowingFn() // CHECK: {{ *}}[[@LINE]]|{{ *}}1
} // CHECK: {{ *}}[[@LINE]]|{{ *}}0
_ =try?test31() // CHECK: {{ *}}[[@LINE]]|{{ *}}1
func test32()throws{ // CHECK: {{ *}}[[@LINE]]|{{ *}}1
iftrythrowingBool(), // CHECK: {{ *}}[[@LINE]]|{{ *}}1
trythrowingBool(){ // CHECK: {{ *}}[[@LINE]]|{{ *}}0
trythrowingFn() // CHECK: {{ *}}[[@LINE]]|{{ *}}0
}else{ // CHECK: {{ *}}[[@LINE]]|{{ *}}0
trythrowingFn() // CHECK: {{ *}}[[@LINE]]|{{ *}}0
} // CHECK: {{ *}}[[@LINE]]|{{ *}}0
} // CHECK: {{ *}}[[@LINE]]|{{ *}}0
_ =try?test32() // CHECK: {{ *}}[[@LINE]]|{{ *}}1
func test33()throws{ // CHECK: {{ *}}[[@LINE]]|{{ *}}1
iftrynoThrowingBool(), // CHECK: {{ *}}[[@LINE]]|{{ *}}1
trythrowingBool(){ // CHECK: {{ *}}[[@LINE]]|{{ *}}1
trythrowingFn() // CHECK: {{ *}}[[@LINE]]|{{ *}}0
}else{ // CHECK: {{ *}}[[@LINE]]|{{ *}}0
trythrowingFn() // CHECK: {{ *}}[[@LINE]]|{{ *}}0
} // CHECK: {{ *}}[[@LINE]]|{{ *}}0
} // CHECK: {{ *}}[[@LINE]]|{{ *}}0
_ =try?test33() // CHECK: {{ *}}[[@LINE]]|{{ *}}1
func test34()throws{ // CHECK: {{ *}}[[@LINE]]|{{ *}}1
iftrynoThrowingBool(), // CHECK: {{ *}}[[@LINE]]|{{ *}}1
trynoThrowingBool(){ // CHECK: {{ *}}[[@LINE]]|{{ *}}1
trythrowingFn() // CHECK: {{ *}}[[@LINE]]|{{ *}}1
}else{ // CHECK: {{ *}}[[@LINE]]|{{ *}}0
trythrowingFn() // CHECK: {{ *}}[[@LINE]]|{{ *}}0
} // CHECK: {{ *}}[[@LINE]]|{{ *}}0
} // CHECK: {{ *}}[[@LINE]]|{{ *}}0
_ =try?test34() // CHECK: {{ *}}[[@LINE]]|{{ *}}1
func test35()throws{ // CHECK: {{ *}}[[@LINE]]|{{ *}}1
iftry!noThrowingBool(), // CHECK: {{ *}}[[@LINE]]|{{ *}}1
trynoThrowingBool(){ // CHECK: {{ *}}[[@LINE]]|{{ *}}1
trythrowingFn() // CHECK: {{ *}}[[@LINE]]|{{ *}}0
}else{ // CHECK: {{ *}}[[@LINE]]|{{ *}}1
trythrowingFn() // CHECK: {{ *}}[[@LINE]]|{{ *}}1
} // CHECK: {{ *}}[[@LINE]]|{{ *}}0
} // CHECK: {{ *}}[[@LINE]]|{{ *}}0
_ =try?test35() // CHECK: {{ *}}[[@LINE]]|{{ *}}1
func test36()throws->Int{ // CHECK: {{ *}}[[@LINE]]|{{ *}}1
guardtrythrowingBool()else{ // CHECK: {{ *}}[[@LINE]]|{{ *}}1
return1 // CHECK: {{ *}}[[@LINE]]|{{ *}}0
} // CHECK: {{ *}}[[@LINE]]|{{ *}}0
return0 // CHECK: {{ *}}[[@LINE]]|{{ *}}0
} // CHECK: {{ *}}[[@LINE]]|{{ *}}1
_ =try?test36() // CHECK: {{ *}}[[@LINE]]|{{ *}}1
func test37()throws->Int{ // CHECK: {{ *}}[[@LINE]]|{{ *}}1
guardtrynoThrowingBool()else{ // CHECK: {{ *}}[[@LINE]]|{{ *}}1
return1 // CHECK: {{ *}}[[@LINE]]|{{ *}}0
} // CHECK: {{ *}}[[@LINE]]|{{ *}}1
return0 // CHECK: {{ *}}[[@LINE]]|{{ *}}1
} // CHECK: {{ *}}[[@LINE]]|{{ *}}1
_ =try?test37() // CHECK: {{ *}}[[@LINE]]|{{ *}}1
func test38()throws->Int{ // CHECK: {{ *}}[[@LINE]]|{{ *}}1
guardtry!noThrowingBool()else{ // CHECK: {{ *}}[[@LINE]]|{{ *}}1
return1 // CHECK: {{ *}}[[@LINE]]|{{ *}}1
} // CHECK: {{ *}}[[@LINE]]|{{ *}}1
return0 // CHECK: {{ *}}[[@LINE]]|{{ *}}0
} // CHECK: {{ *}}[[@LINE]]|{{ *}}1
_ =try?test38() // CHECK: {{ *}}[[@LINE]]|{{ *}}1
func test39()throws->Int{ // CHECK: {{ *}}[[@LINE]]|{{ *}}1
switchtrythrowingBool(){ // CHECK: {{ *}}[[@LINE]]|{{ *}}1
casetrue: // CHECK: {{ *}}[[@LINE]]|{{ *}}0
return0 // CHECK: {{ *}}[[@LINE]]|{{ *}}0
casefalse: // CHECK: {{ *}}[[@LINE]]|{{ *}}0
return1 // CHECK: {{ *}}[[@LINE]]|{{ *}}0
} // CHECK: {{ *}}[[@LINE]]|{{ *}}0
} // CHECK: {{ *}}[[@LINE]]|{{ *}}0
_ =try?test39() // CHECK: {{ *}}[[@LINE]]|{{ *}}1
// FIXME: The line coverage for the second case isn't great (rdar://118654503).
func test40()throws->Int{ // CHECK: {{ *}}[[@LINE]]|{{ *}}1
switchtrynoThrowingBool(){ // CHECK: {{ *}}[[@LINE]]|{{ *}}1
casetrue: // CHECK: {{ *}}[[@LINE]]|{{ *}}1
return0 // CHECK: {{ *}}[[@LINE]]|{{ *}}1
casefalse: // CHECK: {{ *}}[[@LINE]]|{{ *}}1
return1 // CHECK: {{ *}}[[@LINE]]|{{ *}}0
} // CHECK: {{ *}}[[@LINE]]|{{ *}}1
} // CHECK: {{ *}}[[@LINE]]|{{ *}}1
_ =try?test40() // CHECK: {{ *}}[[@LINE]]|{{ *}}1
// FIXME: The line coverage for the first case isn't great (rdar://118654503).
func test41()throws->Int{ // CHECK: {{ *}}[[@LINE]]|{{ *}}1
switchtry!noThrowingBool(){ // CHECK: {{ *}}[[@LINE]]|{{ *}}1
casetrue: // CHECK: {{ *}}[[@LINE]]|{{ *}}1
return0 // CHECK: {{ *}}[[@LINE]]|{{ *}}0
casefalse: // CHECK: {{ *}}[[@LINE]]|{{ *}}1
return1 // CHECK: {{ *}}[[@LINE]]|{{ *}}1
} // CHECK: {{ *}}[[@LINE]]|{{ *}}1
} // CHECK: {{ *}}[[@LINE]]|{{ *}}1
_ =try?test41() // CHECK: {{ *}}[[@LINE]]|{{ *}}1
func test42()throws->Int{ // CHECK: {{ *}}[[@LINE]]|{{ *}}1
letx=switchtrythrowingBool(){ // CHECK: {{ *}}[[@LINE]]|{{ *}}1
casetrue: // CHECK: {{ *}}[[@LINE]]|{{ *}}0
0 // CHECK: {{ *}}[[@LINE]]|{{ *}}0
casefalse: // CHECK: {{ *}}[[@LINE]]|{{ *}}0
1 // CHECK: {{ *}}[[@LINE]]|{{ *}}0
} // CHECK: {{ *}}[[@LINE]]|{{ *}}0
return x // CHECK: {{ *}}[[@LINE]]|{{ *}}0
} // CHECK: {{ *}}[[@LINE]]|{{ *}}1
_ =try?test42() // CHECK: {{ *}}[[@LINE]]|{{ *}}1
// FIXME: The line coverage for the second case isn't great (rdar://118654503).
func test43()throws->Int{ // CHECK: {{ *}}[[@LINE]]|{{ *}}1
letx=switchtrynoThrowingBool(){ // CHECK: {{ *}}[[@LINE]]|{{ *}}1
casetrue: // CHECK: {{ *}}[[@LINE]]|{{ *}}1
0 // CHECK: {{ *}}[[@LINE]]|{{ *}}1
casefalse: // CHECK: {{ *}}[[@LINE]]|{{ *}}1
1 // CHECK: {{ *}}[[@LINE]]|{{ *}}0
} // CHECK: {{ *}}[[@LINE]]|{{ *}}1
return x // CHECK: {{ *}}[[@LINE]]|{{ *}}1
} // CHECK: {{ *}}[[@LINE]]|{{ *}}1
_ =try?test43() // CHECK: {{ *}}[[@LINE]]|{{ *}}1
// FIXME: The line coverage for the first case isn't great (rdar://118654503).
func test44()throws->Int{ // CHECK: {{ *}}[[@LINE]]|{{ *}}1
letx=switchtry!noThrowingBool(){ // CHECK: {{ *}}[[@LINE]]|{{ *}}1
casetrue: // CHECK: {{ *}}[[@LINE]]|{{ *}}1
0 // CHECK: {{ *}}[[@LINE]]|{{ *}}0
casefalse: // CHECK: {{ *}}[[@LINE]]|{{ *}}1
1 // CHECK: {{ *}}[[@LINE]]|{{ *}}1
} // CHECK: {{ *}}[[@LINE]]|{{ *}}1
return x // CHECK: {{ *}}[[@LINE]]|{{ *}}1
} // CHECK: {{ *}}[[@LINE]]|{{ *}}1
_ =try?test44() // CHECK: {{ *}}[[@LINE]]|{{ *}}1