Files
swift-mirror/test/Profiler/coverage_private.swift
Vedant Kumar a9da803033 [SILProfiler] Set up profiling for lazily-emitted functions (#22403)
A SIL function that's initially only emitted as a declaration may later
be prepared for definition. When this happens, set up a profiler for the
definition.

This makes code coverage visible for private methods (the frontend
follows a declare-then-define pattern for these).

rdar://47759243
2019-02-05 19:57:18 -08:00

15 lines
417 B
Swift

// RUN: %target-swift-frontend -Xllvm -sil-full-demangle -profile-generate -profile-coverage-mapping -emit-sorted-sil -emit-sil -module-name coverage_private %s | %FileCheck %s
struct S {
func visible() {
hidden()
}
// CHECK-LABEL: sil_coverage_map {{.*}}// coverage_private.S.(hidden in {{.*}})() -> ()
// CHECK-NEXT: [[@LINE+1]]:25 -> [[@LINE+2]]:4 : 0
private func hidden() {
}
}
S().visible()