- Notifications
You must be signed in to change notification settings - Fork 10.5k
/
Copy pathcoverage_result_builder.swift
32 lines (29 loc) · 822 Bytes
/
coverage_result_builder.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
// RUN: %target-swift-frontend -Xllvm -sil-full-demangle -profile-generate -profile-coverage-mapping -emit-sorted-sil -emit-sil -module-name coverage_functon_builder %s | %FileCheck %s
// RUN: %target-swift-frontend -profile-generate -profile-coverage-mapping -emit-ir %s
@resultBuilder
structSummer{
staticfunc buildBlock(_ x:Int...)->Int{
return x.reduce(0,+)
}
staticfunc buildIf(_ x:Int?)->Int{
return x ??0
}
}
// CHECK-LABEL: sil_coverage_map {{.*}} "$s24coverage_functon_builder5test0SiyF"
@Summer
func test0()->Int{
// CHECK: [[@LINE-1]]:21 -> [[@LINE+3]]:2 : 0
18
12
}
// CHECK-LABEL: sil_coverage_map {{.*}} "$s24coverage_functon_builder5test1SiyF"
@Summer
func test1()->Int{
// CHECK: [[@LINE-1]]:21 -> [[@LINE+7]]:2 : 0
18
12
if7<23{
11
8
}
}