mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
Remove a case where we know we don't have a profiler, and avoid incrementing for a distributed factory method. Otherwise such cases could pass a null ASTNode, which will become an assertion failure in a future commit. While we're here, let's standardize on emitting the profiler increment for function entry after the prolog, as if there's e.g an unreachable parameter, the increment can be safely elided anyway.
17 lines
733 B
Swift
17 lines
733 B
Swift
// RUN: %target-swift-frontend -Xllvm -sil-full-demangle -profile-generate -profile-coverage-mapping -emit-sil -module-name coverage_non_constructible_enum %s | %FileCheck %s
|
|
|
|
// Reduced from Carthage (https://github.com/Carthage/Carthage).
|
|
enum NoError: Error, Equatable {
|
|
// We don't need to emit the increment_profiler_counter, as the function is
|
|
// uncallable.
|
|
// CHECK-LABEL: static coverage_non_constructible_enum.NoError.== infix
|
|
// CHECK-NOT: increment_profiler_counter
|
|
// CHECK: unreachable
|
|
|
|
// CHECK-LABEL: sil_coverage_map {{.*}} static coverage_non_constructible_enum.NoError.== infix
|
|
// CHECK-NEXT: [[@LINE+1]]:54 -> [[@LINE+3]]:4 : 0
|
|
static func ==(lhs: NoError, rhs: NoError) -> Bool {
|
|
return true
|
|
}
|
|
}
|