Skip to content

Commit ca1e808

Browse files
Replace all 9999 availability in non-stdlib tests. (#26109)
Replace all 9999 availability in non-stdlib tests with the appropriate platform availability.
1 parent 690409d commit ca1e808

20 files changed

+112
-118
lines changed

test/IRGen/opaque_result_type_access_path.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,18 +31,18 @@ extension X : P where T : P {
3131
}
3232
}
3333

34-
@available(macOS 9999, iOS 9999, tvOS 9999, watchOS 9999, *)
34+
@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *)
3535
func bar() -> some P {
3636
return 27
3737
}
3838

39-
@available(macOS 9999, iOS 9999, tvOS 9999, watchOS 9999, *)
39+
@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *)
4040
func foo() -> some P {
4141
return X(bar())
4242
}
4343

4444
// CHECK: 27
45-
if #available(macOS 9999, iOS 9999, tvOS 9999, watchOS 9999, *) {
45+
if #available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *) {
4646
print(foo().get())
4747
} else {
4848
print(27)

test/Interpreter/Inputs/dynamic_replacement_opaque1.swift

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,18 +9,18 @@ extension Int: P {
99

1010
}
1111

12-
@available(macOS 9999, iOS 9999, tvOS 9999, watchOS 9999, *)
12+
@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *)
1313
func bar(_ x: Int) -> some P {
1414
return x
1515
}
1616

1717
struct Container {
18-
@available(macOS 9999, iOS 9999, tvOS 9999, watchOS 9999, *)
18+
@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *)
1919
func bar(_ x: Int) -> some P {
2020
return x
2121
}
2222

23-
@available(macOS 9999, iOS 9999, tvOS 9999, watchOS 9999, *)
23+
@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *)
2424
var computedProperty : some P {
2525
get {
2626
return 2
@@ -30,7 +30,7 @@ struct Container {
3030
}
3131
}
3232

33-
@available(macOS 9999, iOS 9999, tvOS 9999, watchOS 9999, *)
33+
@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *)
3434
subscript(_ x: Int) -> some P {
3535
get {
3636
return 2
@@ -49,12 +49,12 @@ extension Int : Q {}
4949

5050
public protocol Assoc {
5151
associatedtype A = Int
52-
@available(macOS 9999, iOS 9999, tvOS 9999, watchOS 9999, *)
52+
@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *)
5353
func act() -> A
5454
}
5555

5656
struct Test : Assoc {
57-
@available(macOS 9999, iOS 9999, tvOS 9999, watchOS 9999, *)
57+
@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *)
5858
func act() -> some Q {
5959
return 1
6060
}

test/Interpreter/Inputs/dynamic_replacement_opaque2.swift

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,20 +8,20 @@ struct Pair : P {
88
}
99
}
1010

11-
@available(macOS 9999, iOS 9999, tvOS 9999, watchOS 9999, *)
11+
@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *)
1212
@_dynamicReplacement(for:bar(_:))
1313
func _replacement_bar(y x: Int) -> some P {
1414
return Pair()
1515
}
1616

1717
extension Container {
18-
@available(macOS 9999, iOS 9999, tvOS 9999, watchOS 9999, *)
18+
@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *)
1919
@_dynamicReplacement(for:bar(_:))
2020
func _replacement_bar(y x: Int) -> some P {
2121
return Pair()
2222
}
2323

24-
@available(macOS 9999, iOS 9999, tvOS 9999, watchOS 9999, *)
24+
@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *)
2525
@_dynamicReplacement(for: computedProperty)
2626
var _replacement_computedProperty : some P {
2727
get {
@@ -32,7 +32,7 @@ extension Container {
3232
}
3333
}
3434

35-
@available(macOS 9999, iOS 9999, tvOS 9999, watchOS 9999, *)
35+
@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *)
3636
@_dynamicReplacement(for: subscript(_:))
3737
subscript(y x: Int) -> some P {
3838
get {
@@ -45,7 +45,7 @@ extension Container {
4545
}
4646

4747
extension Test {
48-
@available(macOS 9999, iOS 9999, tvOS 9999, watchOS 9999, *)
48+
@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *)
4949
@_dynamicReplacement(for: act)
5050
func act_r() -> some Q {
5151
return NewType()

test/Interpreter/SDK/SwiftNativeNSXXXCoding.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ private func test<T: NSObject & NSCoding>(type: T.Type) {
3131
// Test all the classes listed in SwiftNativeNSXXXBase.mm.gyb except for
3232
// NSEnumerator (which doesn't conform to NSCoding).
3333

34-
if #available(iOS 9999, macOS 9999, tvOS 9999, watchOS 9999, *) {
34+
if #available(iOS 13, macOS 10.15, tvOS 13, watchOS 6, *) {
3535
testSuite.test("NSArray") {
3636
test(type: NSArray.self)
3737
}

test/Interpreter/SDK/check_class_for_archiving.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ print("DerivedClassWithName: \(NSKeyedUnarchiver._swift_checkClassAndWarnForKeye
5252
// CHECK: NSKeyedUnarchiver: 0
5353
print("NSKeyedUnarchiver: \(NSKeyedUnarchiver._swift_checkClassAndWarnForKeyedArchiving(NSKeyedUnarchiver.self, operation: op))")
5454

55-
if #available(iOS 9999, macOS 9999, tvOS 9999, watchOS 9999, *) {
55+
if #available(iOS 13, macOS 10.15, tvOS 13, watchOS 6, *) {
5656
// CHECK: PrivateClass: 2
5757
print("PrivateClass: \(NSKeyedUnarchiver._swift_checkClassAndWarnForKeyedArchiving(PrivateClass.self, operation: op))")
5858
// CHECK: GenericClass: 1

test/Interpreter/SDK/check_class_for_archiving_log.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
import Foundation
1414

1515
// A tricky way to make the FileCheck tests conditional on the OS version.
16-
if #available(iOS 9999, macOS 9999, tvOS 9999, watchOS 9999, *) {
16+
if #available(iOS 13, macOS 10.15, tvOS 13, watchOS 6, *) {
1717
print("-check-prefix=CHECK")
1818
} else {
1919
// Disable the checks for older OSes because of rdar://problem/50504765

test/Interpreter/SDK/objc_getClass.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ testSuite.test("GenericMangled")
179179
reason: "objc_getClass hook not present"))
180180
.requireOwnProcess()
181181
.code {
182-
guard #available(macOS 9999, iOS 9999, watchOS 9999, tvOS 9999, *) else { return }
182+
guard #available(macOS 10.15, iOS 13, watchOS 6, tvOS 13, *) else { return }
183183
requireClass(named: "_TtC4main24ConstrainedSwiftSubclass",
184184
demangledName: "main.ConstrainedSwiftSubclass")
185185
requireClass(named: "_TtC4main26ConstrainedSwiftSuperclass",
@@ -226,7 +226,7 @@ testSuite.test("ResilientNSObject")
226226
reason: "objc_getClass hook not present"))
227227
.requireOwnProcess()
228228
.code {
229-
guard #available(macOS 9999, iOS 9999, watchOS 9999, tvOS 9999, *) else { return }
229+
guard #available(macOS 10.15, iOS 13, watchOS 6, tvOS 13, *) else { return }
230230
requireClass(named: "_TtC4main27ResilientSubclassOfNSObject",
231231
demangledName: "main.ResilientSubclassOfNSObject")
232232
requireClass(named: "_TtC4main34ResilientSubclassOfGenericNSObject",

test/Interpreter/arrays.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,4 +182,4 @@ do {
182182
// CHECK: deinit called
183183
// CHECK: error thrown
184184
print("error thrown")
185-
}
185+
}

test/Interpreter/dynamic_replacement_multifile/Inputs/dynamic_replacement_multi_file_A.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,23 +7,23 @@ func replaceable1_r() -> Int {
77
return 2
88
}
99

10-
@available(macOS 9999, iOS 9999, tvOS 9999, watchOS 9999, *)
10+
@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *)
1111
dynamic func bar1(_ x: Int) -> some P {
1212
return x
1313
}
1414

15-
@available(macOS 9999, iOS 9999, tvOS 9999, watchOS 9999, *)
15+
@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *)
1616
@_dynamicReplacement(for: bar1(_:))
1717
func bar1_r(_ x: Int) -> some P {
1818
return Pair()
1919
}
2020

21-
@available(macOS 9999, iOS 9999, tvOS 9999, watchOS 9999, *)
21+
@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *)
2222
dynamic func bar2(_ x: Int) -> some P {
2323
return x
2424
}
2525

26-
@available(macOS 9999, iOS 9999, tvOS 9999, watchOS 9999, *)
26+
@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *)
2727
@_dynamicReplacement(for: bar2(_:))
2828
func bar2_r(_ x: Int) -> some P {
2929
return Pair()

test/Interpreter/dynamic_replacement_multifile/Inputs/dynamic_replacement_multi_file_B.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,12 @@ func replaceable2_r() -> Int {
77
return 3
88
}
99

10-
@available(macOS 9999, iOS 9999, tvOS 9999, watchOS 9999, *)
10+
@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *)
1111
dynamic func bar3(_ x: Int) -> some P {
1212
return x
1313
}
1414

15-
@available(macOS 9999, iOS 9999, tvOS 9999, watchOS 9999, *)
15+
@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *)
1616
@_dynamicReplacement(for: bar3(_:))
1717
func bar3_r(_ x: Int) -> some P {
1818
return Pair()

test/Interpreter/dynamic_replacement_multifile/main.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,12 +34,12 @@ struct Pair {
3434

3535
extension Pair : P {}
3636

37-
@available(macOS 9999, iOS 9999, tvOS 9999, watchOS 9999, *)
37+
@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *)
3838
dynamic func bar(_ x: Int) -> some P {
3939
return x
4040
}
4141

42-
@available(macOS 9999, iOS 9999, tvOS 9999, watchOS 9999, *)
42+
@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *)
4343
@_dynamicReplacement(for: bar(_:))
4444
func bar_r(_ x: Int) -> some P {
4545
return Pair()
@@ -48,7 +48,7 @@ func bar_r(_ x: Int) -> some P {
4848
var DynamicallyReplaceable = TestSuite("DynamicallyReplaceable")
4949

5050
DynamicallyReplaceable.test("DynamicallyReplaceable") {
51-
if #available(macOS 9999, iOS 9999, tvOS 9999, watchOS 9999, *) {
51+
if #available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *) {
5252
expectEqual(1, replaceable())
5353
expectEqual(2, replaceable1())
5454
expectEqual(3, replaceable2())

test/Interpreter/dynamic_replacement_opaque_result.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ func testAssociatedType<T: Assoc> (_ t: T) {
3737
print(T.A.self)
3838
}
3939

40-
@available(macOS 9999, iOS 9999, tvOS 9999, watchOS 9999, *)
40+
@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *)
4141
func test() {
4242
print(MemoryLayout.size(ofValue: bar(5)))
4343
print(MemoryLayout.size(ofValue: Container().bar(5)))
@@ -57,7 +57,7 @@ func test() {
5757
// CHECK: 2
5858
// CHECK: 8
5959
// CHECK: 2
60-
if #available(macOS 9999, iOS 9999, tvOS 9999, watchOS 9999, *) {
60+
if #available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *) {
6161
test()
6262
} else {
6363
print("8 8 5 5 8 2 8 2")
@@ -83,7 +83,7 @@ executablePath.removeLast(4)
8383
// CHECK: 16
8484
// CHECK: 1
8585
// CHECK: NewType
86-
if #available(macOS 9999, iOS 9999, tvOS 9999, watchOS 9999, *) {
86+
if #available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *) {
8787
test()
8888
testAssociatedType(Test())
8989
} else {

test/Interpreter/dynamic_replacement_opaque_result2.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
public protocol Assoc {
1111
associatedtype A = Int
1212

13-
@available(macOS 9999, iOS 9999, tvOS 9999, watchOS 9999, *)
13+
@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *)
1414
func act() -> A
1515
}
1616

@@ -29,14 +29,14 @@ extension Int : P {
2929
struct Pair : P {}
3030

3131
struct Test : Assoc {
32-
@available(macOS 9999, iOS 9999, tvOS 9999, watchOS 9999, *)
32+
@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *)
3333
dynamic func act() -> some P {
3434
return 1
3535
}
3636
}
3737

3838
extension Test {
39-
@available(macOS 9999, iOS 9999, tvOS 9999, watchOS 9999, *)
39+
@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *)
4040
@_dynamicReplacement(for: act)
4141
func act_r() -> some P {
4242
return Pair()
@@ -46,7 +46,7 @@ extension Test {
4646
func test() {
4747
let t = Test()
4848
// CHECK: Pair
49-
if #available(macOS 9999, iOS 9999, tvOS 9999, watchOS 9999, *) {
49+
if #available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *) {
5050
testAssociatedType(t)
5151
} else {
5252
print("Pair")

test/Interpreter/opaque_return_type_protocol_ext.swift

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,40 @@
11
// RUN: %target-run-simple-swift | %FileCheck %s
22
// REQUIRES: executable_test
33

4-
@available(iOS 9999, macOS 9999, tvOS 9999, watchOS 9999, *)
4+
@available(iOS 13, macOS 10.15, tvOS 13, watchOS 6, *)
55
protocol P {
66
associatedtype AT
77
func foo() -> AT
88
}
99

10-
@available(iOS 9999, macOS 9999, tvOS 9999, watchOS 9999, *)
10+
@available(iOS 13, macOS 10.15, tvOS 13, watchOS 6, *)
1111
struct Adapter<T: P>: P {
1212
var inner: T
1313

14-
@available(iOS 9999, macOS 9999, tvOS 9999, watchOS 9999, *)
14+
@available(iOS 13, macOS 10.15, tvOS 13, watchOS 6, *)
1515
func foo() -> some P {
1616
return inner
1717
}
1818
}
1919

20-
@available(iOS 9999, macOS 9999, tvOS 9999, watchOS 9999, *)
20+
@available(iOS 13, macOS 10.15, tvOS 13, watchOS 6, *)
2121
extension P {
22-
@available(iOS 9999, macOS 9999, tvOS 9999, watchOS 9999, *)
22+
@available(iOS 13, macOS 10.15, tvOS 13, watchOS 6, *)
2323
func foo() -> some P {
2424
return Adapter(inner: self)
2525
}
2626
}
2727

28-
@available(iOS 9999, macOS 9999, tvOS 9999, watchOS 9999, *)
28+
@available(iOS 13, macOS 10.15, tvOS 13, watchOS 6, *)
2929
func getPAT<T: P>(_: T.Type) -> Any.Type {
3030
return T.AT.self
3131
}
3232

33-
@available(iOS 9999, macOS 9999, tvOS 9999, watchOS 9999, *)
33+
@available(iOS 13, macOS 10.15, tvOS 13, watchOS 6, *)
3434
extension Int: P { }
3535

3636
// CHECK: {{Adapter<Int>|too old}}
37-
if #available(iOS 9999, macOS 9999, tvOS 9999, watchOS 9999, *) {
37+
if #available(iOS 13, macOS 10.15, tvOS 13, watchOS 6, *) {
3838
print(getPAT(Int.self))
3939
} else {
4040
print("i'm getting too old for this sh")

test/ParseableInterface/Inputs/opaque-result-types-client.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ func getAssocSubscriptType<T: AssocTypeInference>(_ x: T) -> T.AssocSubscript {
1313
struct MyFoo: Foo {}
1414
struct YourFoo: Foo {}
1515

16-
@available(macOS 9999, iOS 9999, tvOS 9999, watchOS 9999, *)
16+
@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *)
1717
func someTypeIsTheSame() {
1818
var a = foo(0)
1919
a = foo(0)

0 commit comments

Comments
 (0)