Files
swift-mirror/test/SourceKit/Diagnostics/embedded_non_wmo.swift
Ben Barham a2fda1d9f3 [Embedded] Do not produce cannot_specialize_class for live issues
SourceKit explicitly disables WMO, silence the diagnostic in this case
(but leave it enabled for explicit non-WMO builds otherwise).
2024-12-19 15:31:41 -08:00

38 lines
805 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)
}
@main
struct Main {
var someClass = SomeClass()
static func main() {
foo()
}
}
//--- file2.swift
final class SomeClass {}
func bar<T>(_ T: T.Type) {}
// CHECK: {
// CHECK-NEXT: key.diagnostics: [
// CHECK-NEXT: ]
// CHECK-NEXT: }