Files
swift-mirror/test/SILOptimizer/mandatory_perfopt_multimodule.swift
Erik Eckstein da484f3146 MandatoryPerformanceOptimization: don't recursive into referenced functions if they are not called
Fixes a false compiler error when referencing a function from a global with a section attribute.

rdar://154332540
2025-06-27 10:01:42 +02:00

25 lines
652 B
Swift

// RUN: %empty-directory(%t)
// RUN: split-file %s %t
// RUN: %target-swift-frontend -emit-module -parse-as-library -enable-library-evolution %t/module.swift -emit-module-path=%t/Module.swiftmodule -module-name=Module
// RUN: %target-swift-frontend -emit-sil -o /dev/null -parse-as-library %t/main.swift -I%t -enable-experimental-feature SymbolLinkageMarkers
// REQUIRES: swift_feature_SymbolLinkageMarkers
// Check that this compiles successfully
//--- module.swift
public struct X: ~Copyable {
public init() {}
deinit {
print("deinit")
}
}
//--- main.swift
import Module
@_section("__TEXT,__mysection")
var g: () -> () = { _ = X() }