mirror of
https://github.com/apple/swift.git
synced 2026-01-17 12:17:35 +01:00
Fix a crash in emitBuiltinCall() which occurs because we drop function
linkage information when creating SILCoverageMaps.
This re-applies 45c7e4e86 with the MachO-specific checks in the test
case removed.
21 lines
962 B
Swift
21 lines
962 B
Swift
// RUN: %target-swift-frontend %s -profile-generate -profile-coverage-mapping -emit-sil -o - | FileCheck %s --check-prefix=SIL
|
|
// RUN: %target-swift-frontend %s -profile-generate -profile-coverage-mapping -emit-ir -o - | FileCheck %s --check-prefix=IR
|
|
|
|
// SIL-DAG: sil hidden @_TF8coverage2f1FT_T_
|
|
// SIL-DAG: string_literal utf8 "_TF8coverage2f1FT_T_"
|
|
// IR-DAG: @__profn__TF8coverage2f1FT_T_ {{.*}} c"_TF8coverage2f1FT_T_"
|
|
internal func f1() {}
|
|
|
|
// SIL-DAG: sil private @_TF8coverageP33_[[F2HASH:[_a-zA-Z0-9]+]]
|
|
// SIL-DAG: string_literal utf8 "{{.*}}coverage.swift:_TF8coverageP33_[[F2HASH]]"
|
|
// IR-DAG: @"__profn_{{.*}}coverage.swift:_TF8coverageP33_[[F2HASH:[_a-zA-Z0-9]+]]" {{.*}} c"{{.*}}coverage.swift:_TF8coverageP33_[[F2HASH]]"
|
|
private func f2() {}
|
|
|
|
// SIL-DAG: sil @_TF8coverage2f3FT_T_
|
|
// SIL-DAG: string_literal utf8 "_TF8coverage2f3FT_T_"
|
|
// IR-DAG: @__profn__TF8coverage2f3FT_T_ {{.*}} c"_TF8coverage2f3FT_T_"
|
|
public func f3() {
|
|
f1();
|
|
f2();
|
|
}
|