mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
* [Coverage] Parse SIL coverage maps for top-level code decls This adds SIL printer/parser support for SILCoverageMaps representing top-level code decls. * [Coverage] Test lowering of ill-formed SIL profiling intrinsics This adds a test case to exercise a path in IRGen which discards ill-formed profiling intrinsics. rdar://40133800 & r://39146527
30 lines
1.0 KiB
Swift
30 lines
1.0 KiB
Swift
// RUN: %target-swift-frontend -Xllvm -sil-full-demangle -profile-generate -profile-coverage-mapping -emit-sorted-sil -emit-sil -module-name coverage_var_init %s | %FileCheck %s
|
|
|
|
final class VarInit {
|
|
// CHECK: sil_coverage_map {{.*}} "$S17coverage_var_init7VarInitC04lazydE033_49373CB2DFB47C8DC62FA963604688DFLLSSvgSSyXEfU_"
|
|
// CHECK-NEXT: [[@LINE+1]]:42 -> [[@LINE+3]]:4 : 0
|
|
private lazy var lazyVarInit: String = {
|
|
return "lazyVarInit"
|
|
}()
|
|
|
|
// CHECK: sil_coverage_map {{.*}} "$S17coverage_var_init7VarInitC05basicdE033_49373CB2DFB47C8DC62FA963604688DFLLSSvpfiSSyXEfU_"
|
|
// CHECK-NEXT: [[@LINE+1]]:38 -> [[@LINE+3]]:4 : 0
|
|
private var basicVarInit: String = {
|
|
return "Hello"
|
|
}()
|
|
|
|
// CHECK: sil_coverage_map {{.*}} "$S17coverage_var_init7VarInitC06simpleD033_49373CB2DFB47C8DC62FA963604688DFLLSSvg"
|
|
// CHECK-NEXT: [[@LINE+1]]:33 -> [[@LINE+3]]:4 : 0
|
|
private var simpleVar: String {
|
|
return "Hello"
|
|
}
|
|
|
|
func coverageFunction() {
|
|
print(lazyVarInit)
|
|
print(basicVarInit)
|
|
print(simpleVar)
|
|
}
|
|
}
|
|
|
|
VarInit().coverageFunction()
|