Skip to content

Commit 1a84348

Browse files
authored
Merge pull request #82454 from swiftlang/egorzhdan/runtime-avail
[cxx-interop] Fix test failure on older macOS
2 parents 24aaff9 + a292113 commit 1a84348

File tree

1 file changed

+22
-9
lines changed

1 file changed

+22
-9
lines changed
Lines changed: 22 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// RUN: %target-run-simple-swift(-cxx-interoperability-mode=default -Xfrontend -disable-availability-checking -I %S/Inputs) | %FileCheck %s
1+
// RUN: %target-run-simple-swift(-cxx-interoperability-mode=default -I %S/Inputs) | %FileCheck %s
22

33
// REQUIRES: executable_test
44

@@ -12,31 +12,44 @@
1212
import Printed
1313

1414
func printCxxImmortalFRT() {
15-
let s = ImmortalFRT()
16-
print(s)
15+
if #available(SwiftStdlib 6.2, *) {
16+
let s = ImmortalFRT()
17+
print(s)
18+
} else {
19+
print("runtime too old")
20+
}
1721
}
1822

23+
@available(SwiftStdlib 5.9, *)
1924
extension FRTCustomStringConvertible : CustomStringConvertible {
2025
public var description: String {
2126
return "FRTCustomStringConvertible(publ: \(publ))"
2227
}
2328
}
2429

2530
func printCxxFRTCustomStringConvertible() {
26-
let s = FRTCustomStringConvertible()
27-
print(s)
31+
if #available(SwiftStdlib 5.9, *) {
32+
let s = FRTCustomStringConvertible()
33+
print(s)
34+
} else {
35+
print("runtime too old")
36+
}
2837
}
2938

3039
func printCxxFRType() {
31-
let s = FRType()
32-
print(s)
40+
if #available(SwiftStdlib 6.2, *) {
41+
let s = FRType()
42+
print(s)
43+
} else {
44+
print("runtime too old")
45+
}
3346
}
3447

3548
printCxxImmortalFRT()
36-
// CHECK: ImmortalFRT()
49+
// CHECK: {{ImmortalFRT()|runtime too old}}
3750

3851
printCxxFRTCustomStringConvertible()
3952
// CHECK: FRTCustomStringConvertible(publ: 2)
4053

4154
printCxxFRType()
42-
// CHECK: FRType()
55+
// CHECK: {{FRType()|runtime too old}}

0 commit comments

Comments
 (0)