mirror of
https://github.com/apple/swift.git
synced 2026-03-04 18:24:35 +01:00
This enables the use of reference-counted foreign reference types on Windows. As it turns out, the assertion that was failing on Windows previously was unnecessary. This also enabled many of the tests on Windows. rdar://154694125 / resolves https://github.com/swiftlang/swift/issues/82643
53 lines
1.2 KiB
Swift
53 lines
1.2 KiB
Swift
// RUN: %target-run-simple-swift(-cxx-interoperability-mode=default -I %S/Inputs) | %FileCheck %s
|
|
|
|
// REQUIRES: executable_test
|
|
|
|
// Temporarily disable when running with an older runtime (rdar://153205860)
|
|
// UNSUPPORTED: use_os_stdlib
|
|
// UNSUPPORTED: back_deployment_runtime
|
|
|
|
import Printed
|
|
|
|
func printCxxImmortalFRT() {
|
|
if #available(SwiftStdlib 6.2, *) {
|
|
let s = ImmortalFRT()
|
|
print(s)
|
|
} else {
|
|
print("runtime too old")
|
|
}
|
|
}
|
|
|
|
@available(SwiftStdlib 5.9, *)
|
|
extension FRTCustomStringConvertible : CustomStringConvertible {
|
|
public var description: String {
|
|
return "FRTCustomStringConvertible(publ: \(publ))"
|
|
}
|
|
}
|
|
|
|
func printCxxFRTCustomStringConvertible() {
|
|
if #available(SwiftStdlib 5.9, *) {
|
|
let s = FRTCustomStringConvertible()
|
|
print(s)
|
|
} else {
|
|
print("runtime too old")
|
|
}
|
|
}
|
|
|
|
func printCxxFRType() {
|
|
if #available(SwiftStdlib 6.2, *) {
|
|
let s = FRType()
|
|
print(s)
|
|
} else {
|
|
print("runtime too old")
|
|
}
|
|
}
|
|
|
|
printCxxImmortalFRT()
|
|
// CHECK: {{ImmortalFRT()|runtime too old}}
|
|
|
|
printCxxFRTCustomStringConvertible()
|
|
// CHECK: FRTCustomStringConvertible(publ: 2)
|
|
|
|
printCxxFRType()
|
|
// CHECK: {{FRType()|runtime too old}}
|