mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
This fixes the Windows linker 4217 warning seen when building swift-corelibs-foundation for windows, when IRGen adds 'dllimport' to the _bridgeToObjectiveC IR reference within the same Swift module The exact warning fixed: warning LNK4217: symbol 'sSS10FoundationE19_bridgeToObjectiveCAA8NSStringCyF' defined in 'Bridging.swift.obj' is imported by 'NSSet.swift.obj' in function 's10Foundation5NSSetC3set9copyItemsACShys11AnyHashableVG_SbtcfC'
16 lines
595 B
Swift
16 lines
595 B
Swift
// RUN: %target-swift-frontend -O -emit-ir %S/Inputs/foundation_bridging.swift -primary-file %s -disable-autolink-framework CoreFoundation -parse-as-library -module-name Foundation | %FileCheck %s
|
|
|
|
// REQUIRES: OS=windows-msvc
|
|
|
|
open class NSSet {
|
|
public init(_ set: AnyHashable) {
|
|
if let item = set as? NSObject {
|
|
print("yay, has object!")
|
|
}
|
|
}
|
|
}
|
|
|
|
// Ensure that the _bridgeToObjectiveC function (from the same module) is not annotated
|
|
// with 'dllimport'.
|
|
// CHECK: declare swiftcc ptr @"$ss11AnyHashableV10FoundationE19_bridgeToObjectiveCAC8NSObjectCyF"
|