Files
swift-mirror/test/SourceKit/Diagnostics/embedded_non_wmo.swift
Erik Eckstein 08ce2f00f2 embedded: avoid false error "Deinit of non-copyable type not visible in the current module" in SourceKit
As SourceKit explicitly disables WMO, silence the diagnostic in this case (but leave it enabled for explicit non-WMO builds otherwise).

rdar://150596807
2025-05-05 09:19:08 +02:00

48 lines
949 B
Swift

// Check that when emitting diagnostics in SourceKit, we don't report false positives in PerformanceDiagnostics (because WMO is disabled).
// RUN: %empty-directory(%t)
// RUN: split-file %s %t
// RUN: %sourcekitd-test -req=diags %t/file1.swift -- %t/file1.swift %t/file2.swift -enable-experimental-feature Embedded -target %target-cpu-apple-macos14 | %FileCheck %s
// REQUIRES: swift_in_compiler
// REQUIRES: embedded_stdlib
// REQUIRES: OS=macosx
// REQUIRES: swift_feature_Embedded
//--- file1.swift
func foo() {
bar(Int.self)
}
func testNonCopyable() {
let nc = NonCopyable()
nc.doSomething()
}
@main
struct Main {
var someClass = SomeClass()
static func main() {
foo()
}
}
//--- file2.swift
final class SomeClass {}
func bar<T>(_ T: T.Type) {}
struct NonCopyable : ~Copyable {
func doSomething() {}
deinit {}
}
// CHECK: {
// CHECK-NEXT: key.diagnostics: [
// CHECK-NEXT: ]
// CHECK-NEXT: }