Files
swift-mirror/test/Profiler/issue-57483.swift
Hamish Knight 0431bb2d1c [IRGen] Don't emit coverage maps for synthesized Clang decls
We don't need to perform coverage mapping for any
Clang decls we've synthesized, as they have no
user-written code. This is also needed to avoid a
Clang crash when attempting to emit coverage for
decls without source locations (rdar://100172217).

rdar://82820628
2022-09-20 15:58:07 +01:00

15 lines
527 B
Swift

// RUN: %target-swift-frontend -emit-ir -profile-generate -profile-coverage-mapping -Xcc -fprofile-instr-generate -Xcc -fcoverage-mapping -I %S/Inputs/issue-57483 %s | %FileCheck %s
// https://github.com/apple/swift/issues/57483 (rdar://82820628)
// Make sure we don't crash in IRGen attempting to emit the coverage map for the
// implicit Clang getter for the member bitfield.
// CHECK: define {{.*}} @"$So7cstructV$member$getter"
import CModule
func foo(_ x: UnsafePointer<cstruct>?) {
_ = x?.pointee.member
}
foo(nil)