11
11
12
12
// REQUIRES: swift_stable_abi
13
13
14
-
15
14
// Primary execution of this test. Uses the default minimum inlining version,
16
- // which is the version when the ABI became stable .
17
- // RUN: %target-typecheck-verify-swift -swift-version 5 -enable-library-evolution -target %target-next-stable-abi-triple -target-min-inlining-version abi
15
+ // which is the version when Swift was introduced .
16
+ // RUN: %target-typecheck-verify-swift -swift-version 5 -enable-library-evolution -target %target-next-stable-abi-triple -target-min-inlining-version min
18
17
19
18
20
19
// Check that these rules are only applied when requested and that at least some
@@ -34,12 +33,12 @@ public struct NoAvailable {
34
33
@usableFromInline internal init ( ) { }
35
34
}
36
35
37
- @available ( macOS 10 . 14 . 3 , iOS 12 . 1 , tvOS 12 . 1 , watchOS 5 . 1 , * )
36
+ @available ( macOS 10 . 9 , iOS 7 . 0 , tvOS 8 . 0 , watchOS 1 . 0 , * )
38
37
public struct BeforeInliningTarget {
39
38
@usableFromInline internal init ( ) { }
40
39
}
41
40
42
- @available ( macOS 10 . 14 . 4 , iOS 12 . 2 , tvOS 12 . 2 , watchOS 5 . 2 , * )
41
+ @available ( macOS 10 . 10 , iOS 8 . 0 , tvOS 9 . 0 , watchOS 2 . 0 , * )
43
42
public struct AtInliningTarget {
44
43
@usableFromInline internal init ( ) { }
45
44
}
@@ -90,7 +89,7 @@ public func deployedUseNoAvailable( // expected-note 5 {{add @available attribut
90
89
}
91
90
}
92
91
93
- @available ( macOS 10 . 14 . 3 , iOS 12 . 1 , tvOS 12 . 1 , watchOS 5 . 1 , * )
92
+ @available ( macOS 10 . 9 , iOS 7 . 0 , tvOS 8 . 0 , watchOS 1 . 0 , * )
94
93
public func deployedUseBeforeInliningTarget(
95
94
_: NoAvailable ,
96
95
_: BeforeInliningTarget ,
@@ -115,7 +114,7 @@ public func deployedUseBeforeInliningTarget(
115
114
}
116
115
}
117
116
118
- @available ( macOS 10 . 14 . 4 , iOS 12 . 2 , tvOS 12 . 2 , watchOS 5 . 2 , * )
117
+ @available ( macOS 10 . 10 , iOS 8 . 0 , tvOS 9 . 0 , watchOS 2 . 0 , * )
119
118
public func deployedUseAtInliningTarget(
120
119
_: NoAvailable ,
121
120
_: BeforeInliningTarget ,
@@ -248,7 +247,7 @@ public func deployedUseAfterDeploymentTarget(
248
247
}
249
248
}
250
249
251
- @available ( macOS 10 . 14 . 3 , iOS 12 . 1 , tvOS 12 . 1 , watchOS 5 . 1 , * )
250
+ @available ( macOS 10 . 9 , iOS 7 . 0 , tvOS 8 . 0 , watchOS 1 . 0 , * )
252
251
@inlinable public func inlinedUseBeforeInliningTarget(
253
252
_: NoAvailable ,
254
253
_: BeforeInliningTarget ,
@@ -264,7 +263,7 @@ public func deployedUseAfterDeploymentTarget(
264
263
_ = NoAvailable ( )
265
264
_ = BeforeInliningTarget ( )
266
265
_ = AtInliningTarget ( )
267
- _ = BetweenTargets ( ) // expected-error {{'BetweenTargets' is only available in}} {{18-25=10.14.5}} || {{31-35=12.3}} || {{42-46=12.3}} || {{56-59=5.3 }}
266
+ _ = BetweenTargets ( ) // expected-error {{'BetweenTargets' is only available in}} expected-note {{add 'if #available' }}
268
267
_ = AtDeploymentTarget ( ) // expected-error {{'AtDeploymentTarget' is only available in}} expected-note {{add 'if #available'}}
269
268
_ = AfterDeploymentTarget ( ) // expected-error {{'AfterDeploymentTarget' is only available in}} expected-note {{add 'if #available'}}
270
269
@@ -279,7 +278,7 @@ public func deployedUseAfterDeploymentTarget(
279
278
}
280
279
}
281
280
282
- @available ( macOS 10 . 14 . 4 , iOS 12 . 2 , tvOS 12 . 2 , watchOS 5 . 2 , * )
281
+ @available ( macOS 10 . 10 , iOS 8 . 0 , tvOS 9 . 0 , watchOS 2 . 0 , * )
283
282
@inlinable public func inlinedUseAtInliningTarget(
284
283
_: NoAvailable ,
285
284
_: BeforeInliningTarget ,
@@ -295,7 +294,7 @@ public func deployedUseAfterDeploymentTarget(
295
294
_ = NoAvailable ( )
296
295
_ = BeforeInliningTarget ( )
297
296
_ = AtInliningTarget ( )
298
- _ = BetweenTargets ( ) // expected-error {{'BetweenTargets' is only available in}} {{18-25=10.14.5}} || {{31-35=12.3}} || {{42-46=12.3}} || {{56-59=5.3 }}
297
+ _ = BetweenTargets ( ) // expected-error {{'BetweenTargets' is only available in}} expected-note {{add 'if #available' }}
299
298
_ = AtDeploymentTarget ( ) // expected-error {{'AtDeploymentTarget' is only available in}} expected-note {{add 'if #available'}}
300
299
_ = AfterDeploymentTarget ( ) // expected-error {{'AfterDeploymentTarget' is only available in}} expected-note {{add 'if #available'}}
301
300
@@ -426,6 +425,40 @@ internal func fn() {
426
425
}
427
426
}
428
427
428
+ // @_backDeploy acts like @inlinable.
429
+
430
+ @available ( macOS 10 . 10 , iOS 8 . 0 , tvOS 9 . 0 , watchOS 2 . 0 , * )
431
+ @_backDeploy ( macOS 999 . 0 , iOS 999 . 0 , tvOS 999 . 0 , watchOS 999 . 0 )
432
+ public func backDeployedToInliningTarget(
433
+ _: NoAvailable ,
434
+ _: BeforeInliningTarget ,
435
+ _: AtInliningTarget ,
436
+ _: BetweenTargets , // expected-error {{'BetweenTargets' is only available in}}
437
+ _: AtDeploymentTarget , // expected-error {{'AtDeploymentTarget' is only available in}}
438
+ _: AfterDeploymentTarget // expected-error {{'AfterDeploymentTarget' is only available in}}
439
+ ) {
440
+ defer {
441
+ _ = AtDeploymentTarget ( ) // expected-error {{'AtDeploymentTarget' is only available in}} expected-note {{add 'if #available'}}
442
+ _ = AfterDeploymentTarget ( ) // expected-error {{'AfterDeploymentTarget' is only available in}} expected-note {{add 'if #available'}}
443
+ }
444
+ _ = NoAvailable ( )
445
+ _ = BeforeInliningTarget ( )
446
+ _ = AtInliningTarget ( )
447
+ _ = BetweenTargets ( ) // expected-error {{'BetweenTargets' is only available in}} expected-note {{add 'if #available'}}
448
+ _ = AtDeploymentTarget ( ) // expected-error {{'AtDeploymentTarget' is only available in}} expected-note {{add 'if #available'}}
449
+ _ = AfterDeploymentTarget ( ) // expected-error {{'AfterDeploymentTarget' is only available in}} expected-note {{add 'if #available'}}
450
+
451
+ if #available( macOS 10 . 14 . 5 , iOS 12 . 3 , tvOS 12 . 3 , watchOS 5 . 3 , * ) {
452
+ _ = BetweenTargets ( )
453
+ }
454
+ if #available( macOS 10 . 15 , iOS 13 , tvOS 13 , watchOS 6 , * ) {
455
+ _ = AtDeploymentTarget ( )
456
+ }
457
+ if #available( macOS 11 , iOS 14 , tvOS 14 , watchOS 7 , * ) {
458
+ _ = AfterDeploymentTarget ( )
459
+ }
460
+ }
461
+
429
462
// Default arguments act like @inlinable.
430
463
431
464
public func defaultArgsUseNoAvailable( // expected-note 3 {{add @available attribute}}
0 commit comments