Skip to content

Commit e65480d

Browse files
authored
Merge pull request #69942 from hamishknight/test-tweaks
2 parents bfbc0de + 0f1f950 commit e65480d

File tree

2 files changed

+104
-2
lines changed

2 files changed

+104
-2
lines changed

test/Profiler/coverage_errors.swift

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -241,9 +241,9 @@ func test8(_ b: Bool) -> Int { // CHECK-NEXT: [[@LINE]]:30 {{.*}} : 0
241241
if b { // CHECK-NEXT: [[@LINE]]:10 {{.*}} : 2
242242
return 1
243243
} // CHECK-NEXT: [[@LINE]]:6 {{.*}} : (1 - 2)
244-
} // CHECK: [[@LINE]]:4 {{.*}} : (1 - 2)
244+
} // CHECK-NEXT: [[@LINE]]:4 {{.*}} : (1 - 2)
245245
return 0
246-
}
246+
} // CHECK-NEXT: }
247247

248248
// Test coverage with nested do-catches
249249
// CHECK-LABEL: sil_coverage_map {{.*}} "$s15coverage_errors5test9SiyF"
@@ -362,6 +362,8 @@ func test19() throws -> Int { // CHECK-NEXT: [[@LINE]]:29 -> [[@LINE+
362362
return x // CHECK-NEXT: [[@LINE-1]]:41 -> [[@LINE]]:11 : ((0 - 1) - 2)
363363
} // CHECK-NEXT: }
364364

365+
// TODO: We probably ought to include the function call in the non-throwing
366+
// regions here (rdar://118524386).
365367
// CHECK-LABEL: sil_coverage_map {{.*}} "$s15coverage_errors6test20yyKF"
366368
func test20() throws { // CHECK-NEXT: [[@LINE]]:22 -> [[@LINE+5]]:2 : 0
367369
takesInts(

test/Profiler/rdar118185163.swift

Lines changed: 100 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,100 @@
1+
// RUN: %{python} %S/../Inputs/timeout.py 10 %target-swift-frontend -profile-generate -profile-coverage-mapping -emit-sil -module-name rdar118185163 %s | %FileCheck %s
2+
3+
// rdar://118185163 - Make sure we can generate coverage for this in reasonable
4+
// time.
5+
// CHECK-LABEL: sil_coverage_map {{.*}} "$s13rdar1181851633fooyyF"
6+
func foo() {
7+
do { if .random() {} }
8+
do { if .random() {} }
9+
do { if .random() {} }
10+
do { if .random() {} }
11+
do { if .random() {} }
12+
do { if .random() {} }
13+
do { if .random() {} }
14+
do { if .random() {} }
15+
do { if .random() {} }
16+
do { if .random() {} }
17+
do { if .random() {} }
18+
do { if .random() {} }
19+
do { if .random() {} }
20+
do { if .random() {} }
21+
do { if .random() {} }
22+
do { if .random() {} }
23+
do { if .random() {} }
24+
do { if .random() {} }
25+
do { if .random() {} }
26+
do { if .random() {} }
27+
do { if .random() {} }
28+
do { if .random() {} }
29+
do { if .random() {} }
30+
do { if .random() {} }
31+
do { if .random() {} }
32+
do { if .random() {} }
33+
do { if .random() {} }
34+
do { if .random() {} }
35+
do { if .random() {} }
36+
do { if .random() {} }
37+
do { if .random() {} }
38+
do { if .random() {} }
39+
do { if .random() {} }
40+
do { if .random() {} }
41+
do { if .random() {} }
42+
do { if .random() {} }
43+
do { if .random() {} }
44+
do { if .random() {} }
45+
do { if .random() {} }
46+
do { if .random() {} }
47+
do { if .random() {} }
48+
do { if .random() {} }
49+
do { if .random() {} }
50+
do { if .random() {} }
51+
do { if .random() {} }
52+
do { if .random() {} }
53+
do { if .random() {} }
54+
do { if .random() {} }
55+
do { if .random() {} }
56+
do { if .random() {} }
57+
do { if .random() {} }
58+
do { if .random() {} }
59+
do { if .random() {} }
60+
do { if .random() {} }
61+
do { if .random() {} }
62+
do { if .random() {} }
63+
do { if .random() {} }
64+
do { if .random() {} }
65+
do { if .random() {} }
66+
do { if .random() {} }
67+
do { if .random() {} }
68+
do { if .random() {} }
69+
do { if .random() {} }
70+
do { if .random() {} }
71+
do { if .random() {} }
72+
do { if .random() {} }
73+
do { if .random() {} }
74+
do { if .random() {} }
75+
do { if .random() {} }
76+
do { if .random() {} }
77+
do { if .random() {} }
78+
do { if .random() {} }
79+
do { if .random() {} }
80+
do { if .random() {} }
81+
do { if .random() {} }
82+
do { if .random() {} }
83+
do { if .random() {} }
84+
do { if .random() {} }
85+
do { if .random() {} }
86+
do { if .random() {} }
87+
do { if .random() {} }
88+
do { if .random() {} }
89+
do { if .random() {} }
90+
do { if .random() {} }
91+
do { if .random() {} }
92+
do { if .random() {} }
93+
do { if .random() {} }
94+
do { if .random() {} }
95+
do { if .random() {} }
96+
do { if .random() {} }
97+
do { if .random() {} }
98+
do { if .random() {} }
99+
do { if .random() {} }
100+
}

0 commit comments

Comments
 (0)