Skip to content

Commit 59b62c2

Browse files
committed
NFC: Update tests to include "before: " label in the @_backDeploy attribute.
1 parent 07e54bf commit 59b62c2

11 files changed

+109
-109
lines changed

test/ModuleInterface/back-deploy-attr.swift

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -18,73 +18,73 @@
1818
// RUN: %FileCheck %s --check-prefix FROMMODULE --check-prefix CHECK < %t/TestFromModule.swiftinterface
1919

2020
public struct TopLevelStruct {
21-
// CHECK: @_backDeploy(macOS 12.0)
21+
// CHECK: @_backDeploy(before: macOS 12.0)
2222
// FROMSOURCE: public func backDeployedFunc_SinglePlatform() -> Swift.Int { return 42 }
2323
// FROMMODULE: public func backDeployedFunc_SinglePlatform() -> Swift.Int
2424
@available(macOS 11.0, *)
25-
@_backDeploy(macOS 12.0)
25+
@_backDeploy(before: macOS 12.0)
2626
public func backDeployedFunc_SinglePlatform() -> Int { return 42 }
2727

28-
// CHECK: @_backDeploy(macOS 12.0)
29-
// CHECK: @_backDeploy(iOS 15.0)
28+
// CHECK: @_backDeploy(before: macOS 12.0)
29+
// CHECK: @_backDeploy(before: iOS 15.0)
3030
// FROMSOURCE: public func backDeployedFunc_MultiPlatform() -> Swift.Int { return 43 }
3131
// FROMMODULE: public func backDeployedFunc_MultiPlatform() -> Swift.Int
3232
@available(macOS 11.0, iOS 14.0, *)
33-
@_backDeploy(macOS 12.0, iOS 15.0)
33+
@_backDeploy(before: macOS 12.0, iOS 15.0)
3434
public func backDeployedFunc_MultiPlatform() -> Int { return 43 }
3535

36-
// CHECK: @_backDeploy(macOS 12.0)
36+
// CHECK: @_backDeploy(before: macOS 12.0)
3737
// FROMSOURCE: public var backDeployedComputedProperty: Swift.Int {
3838
// FROMSOURCE: get { 44 }
3939
// FROMSOURCE: }
4040
// FROMMODULE: public var backDeployedComputedProperty: Swift.Int
4141
@available(macOS 11.0, *)
42-
@_backDeploy(macOS 12.0)
42+
@_backDeploy(before: macOS 12.0)
4343
public var backDeployedComputedProperty: Int { 44 }
4444

45-
// CHECK: @_backDeploy(macOS 12.0)
45+
// CHECK: @_backDeploy(before: macOS 12.0)
4646
// FROMSOURCE: public var backDeployedPropertyWithAccessors: Swift.Int {
4747
// FROMSOURCE: get { 45 }
4848
// FROMSOURCE: }
4949
// FROMMODULE: public var backDeployedPropertyWithAccessors: Swift.Int
5050
@available(macOS 11.0, *)
51-
@_backDeploy(macOS 12.0)
51+
@_backDeploy(before: macOS 12.0)
5252
public var backDeployedPropertyWithAccessors: Int {
5353
get { 45 }
5454
}
5555

56-
// CHECK: @_backDeploy(macOS 12.0)
56+
// CHECK: @_backDeploy(before: macOS 12.0)
5757
// FROMSOURCE: public subscript(index: Swift.Int) -> Swift.Int {
5858
// FROMSOURCE: get { 46 }
5959
// FROMSOURCE: }
6060
// FROMMODULE: public subscript(index: Swift.Int) -> Swift.Int
6161
@available(macOS 11.0, *)
62-
@_backDeploy(macOS 12.0)
62+
@_backDeploy(before: macOS 12.0)
6363
public subscript(index: Int) -> Int {
6464
get { 46 }
6565
}
6666
}
6767

68-
// CHECK: @_backDeploy(macOS 12.0)
68+
// CHECK: @_backDeploy(before: macOS 12.0)
6969
// FROMSOURCE: public func backDeployTopLevelFunc1() -> Swift.Int { return 47 }
7070
// FROMMODULE: public func backDeployTopLevelFunc1() -> Swift.Int
7171
@available(macOS 11.0, *)
72-
@_backDeploy(macOS 12.0)
72+
@_backDeploy(before: macOS 12.0)
7373
public func backDeployTopLevelFunc1() -> Int { return 47 }
7474

7575
// MARK: - Availability macros
7676

77-
// CHECK: @_backDeploy(macOS 12.1)
77+
// CHECK: @_backDeploy(before: macOS 12.1)
7878
// FROMSOURCE: public func backDeployTopLevelFunc2() -> Swift.Int { return 48 }
7979
// FROMMODULE: public func backDeployTopLevelFunc2() -> Swift.Int
8080
@available(macOS 11.0, *)
81-
@_backDeploy(_macOS12_1)
81+
@_backDeploy(before: _macOS12_1)
8282
public func backDeployTopLevelFunc2() -> Int { return 48 }
8383

84-
// CHECK: @_backDeploy(macOS 12.1)
85-
// CHECK: @_backDeploy(iOS 15.1)
84+
// CHECK: @_backDeploy(before: macOS 12.1)
85+
// CHECK: @_backDeploy(before: iOS 15.1)
8686
// FROMSOURCE: public func backDeployTopLevelFunc3() -> Swift.Int { return 49 }
8787
// FROMMODULE: public func backDeployTopLevelFunc3() -> Swift.Int
8888
@available(macOS 11.0, iOS 14.0, *)
89-
@_backDeploy(_myProject 1.0)
89+
@_backDeploy(before: _myProject 1.0)
9090
public func backDeployTopLevelFunc3() -> Int { return 49 }

test/SILGen/back_deploy_attribute_accessor.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ public struct TopLevelStruct {
3838
// -- Original definition of TopLevelStruct.property.getter
3939
// CHECK-LABEL: sil [serialized] [available 10.51] [ossa] @$s11back_deploy14TopLevelStructV8propertyACvg : $@convention(method) (TopLevelStruct) -> TopLevelStruct
4040
@available(macOS 10.51, *)
41-
@_backDeploy(macOS 10.52)
41+
@_backDeploy(before: macOS 10.52)
4242
public var property: TopLevelStruct { self }
4343
}
4444

test/SILGen/back_deploy_attribute_func.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
// -- Original definition of trivialFunc()
3939
// CHECK-LABEL: sil [serialized] [available 10.51] [ossa] @$s11back_deploy11trivialFuncyyF : $@convention(thin) () -> ()
4040
@available(macOS 10.51, *)
41-
@_backDeploy(macOS 10.52)
41+
@_backDeploy(before: macOS 10.52)
4242
public func trivialFunc() {}
4343

4444
// -- Fallback definition of isNumber(_:)
@@ -73,7 +73,7 @@ public func trivialFunc() {}
7373
// -- Original definition of isNumber(_:)
7474
// CHECK-LABEL: sil [serialized] [available 10.51] [ossa] @$s11back_deploy8isNumberySbSiF : $@convention(thin) (Int) -> Bool
7575
@available(macOS 10.51, *)
76-
@_backDeploy(macOS 10.52)
76+
@_backDeploy(before: macOS 10.52)
7777
public func isNumber(_ x: Int) -> Bool {
7878
return true
7979
}

test/SILGen/back_deploy_attribute_generic_func.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
// -- Original definition of genericFunc()
4040
// CHECK-LABEL: sil [serialized] [available 10.51] [ossa] @$s11back_deploy11genericFuncyxxlF : $@convention(thin) <T> (@in_guaranteed T) -> @out T
4141
@available(macOS 10.51, *)
42-
@_backDeploy(macOS 10.52)
42+
@_backDeploy(before: macOS 10.52)
4343
public func genericFunc<T>(_ t: T) -> T {
4444
return t
4545
}

test/SILGen/back_deploy_attribute_struct_method.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ public struct TopLevelStruct {
4040
// -- Original definition of TopLevelStruct.trivialMethod()
4141
// CHECK-LABEL: sil [serialized] [available 10.51] [ossa] @$s11back_deploy14TopLevelStructV13trivialMethodyyF : $@convention(method) (TopLevelStruct) -> ()
4242
@available(macOS 10.51, *)
43-
@_backDeploy(macOS 10.52)
43+
@_backDeploy(before: macOS 10.52)
4444
public func trivialMethod() {}
4545
}
4646

test/SILGen/back_deploy_attribute_throwing_func.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@
5151
// -- Original definition of throwingFunc()
5252
// CHECK-LABEL: sil [serialized] [available 10.51] [ossa] @$s11back_deploy12throwingFuncyyKF : $@convention(thin) () -> @error Error
5353
@available(macOS 10.51, *)
54-
@_backDeploy(macOS 10.52)
54+
@_backDeploy(before: macOS 10.52)
5555
public func throwingFunc() throws {}
5656

5757
// CHECK-LABEL: sil hidden [available 10.51] [ossa] @$s11back_deploy6calleryyKF : $@convention(thin) () -> @error Error

test/Sema/availability_define.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ public func forbidMacrosInInlinableCode1() {
8787
}
8888

8989
@available(_iOS8Aligned, *)
90-
@_backDeploy(_iOS9Aligned)
90+
@_backDeploy(before: _iOS9Aligned)
9191
public func forbidMacrosInInlinableCode2() {
9292
if #available(_iOS9Aligned, *) { } // expected-error {{availability macro cannot be used in a '@_backDeploy' function}}
9393
if #available(_iOS9, _macOS10_11, *) { } // expected-error {{availability macro cannot be used in a '@_backDeploy' function}}

test/attr/Inputs/BackDeployHelper.swift

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -95,20 +95,20 @@ extension Int {
9595
#if !STRIP_V2_APIS
9696

9797
@available(BackDeploy 1.0, *)
98-
@_backDeploy(BackDeploy 2.0)
98+
@_backDeploy(before: BackDeploy 2.0)
9999
public func trivial() {
100100
testPrint(handle: #dsohandle, "trivial")
101101
}
102102

103103
@available(BackDeploy 1.0, *)
104-
@_backDeploy(BackDeploy 2.0)
104+
@_backDeploy(before: BackDeploy 2.0)
105105
public func pleaseThrow(_ shouldThrow: Bool) throws -> Bool {
106106
if shouldThrow { throw BadError.bad }
107107
return !shouldThrow
108108
}
109109

110110
@available(BackDeploy 1.0, *)
111-
@_backDeploy(BackDeploy 2.0)
111+
@_backDeploy(before: BackDeploy 2.0)
112112
public func genericIncrement<T: Incrementable>(
113113
_ x: inout T,
114114
by amount: T.Operand
@@ -117,78 +117,78 @@ public func genericIncrement<T: Incrementable>(
117117
}
118118

119119
@available(BackDeploy 1.0, *)
120-
@_backDeploy(BackDeploy 2.0)
120+
@_backDeploy(before: BackDeploy 2.0)
121121
public func existentialIncrementByOne(_ x: inout any Incrementable) {
122122
testPrint(handle: #dsohandle, x.incrementByOne())
123123
}
124124

125125
extension MutableInt {
126126
@available(BackDeploy 1.0, *)
127-
@_backDeploy(BackDeploy 2.0)
127+
@_backDeploy(before: BackDeploy 2.0)
128128
public var value: Int { _value }
129129

130130
@available(BackDeploy 1.0, *)
131-
@_backDeploy(BackDeploy 2.0)
131+
@_backDeploy(before: BackDeploy 2.0)
132132
public func print() {
133133
// Tests recursive @_backDeploy since `value` is also @_backDeploy
134134
testPrint(handle: #dsohandle, String(value))
135135
}
136136

137137
@available(BackDeploy 1.0, *)
138-
@_backDeploy(BackDeploy 2.0)
138+
@_backDeploy(before: BackDeploy 2.0)
139139
public static var zero: Self { MutableInt(0) }
140140

141141
@available(BackDeploy 1.0, *)
142-
@_backDeploy(BackDeploy 2.0)
142+
@_backDeploy(before: BackDeploy 2.0)
143143
public mutating func decrement(by amount: Int) -> Int {
144144
_value -= amount
145145
return _value
146146
}
147147

148148
@available(BackDeploy 1.0, *)
149-
@_backDeploy(BackDeploy 2.0)
149+
@_backDeploy(before: BackDeploy 2.0)
150150
public func toIncrementable() -> any Incrementable { self }
151151

152152
@available(BackDeploy 1.0, *)
153-
@_backDeploy(BackDeploy 2.0)
153+
@_backDeploy(before: BackDeploy 2.0)
154154
public subscript(byteAt index: Int) -> UInt8 { _value.byte(at: index) }
155155
}
156156

157157
extension ReferenceInt {
158158
@available(BackDeploy 1.0, *)
159-
@_backDeploy(BackDeploy 2.0)
159+
@_backDeploy(before: BackDeploy 2.0)
160160
public final var value: Int { _value }
161161

162162
@available(BackDeploy 1.0, *)
163-
@_backDeploy(BackDeploy 2.0)
163+
@_backDeploy(before: BackDeploy 2.0)
164164
public final func print() {
165165
// Tests recursive use of back deployed APIs, since `value` is also
166166
testPrint(handle: #dsohandle, String(value))
167167
}
168168

169169
@available(BackDeploy 1.0, *)
170-
@_backDeploy(BackDeploy 2.0)
170+
@_backDeploy(before: BackDeploy 2.0)
171171
public final func copy() -> ReferenceInt {
172172
return ReferenceInt(value)
173173
}
174174

175175
@available(BackDeploy 1.0, *)
176-
@_backDeploy(BackDeploy 2.0)
176+
@_backDeploy(before: BackDeploy 2.0)
177177
public final class var zero: ReferenceInt { ReferenceInt(0) }
178178

179179
@available(BackDeploy 1.0, *)
180-
@_backDeploy(BackDeploy 2.0)
180+
@_backDeploy(before: BackDeploy 2.0)
181181
public final func decrement(by amount: Int) -> Int {
182182
_value -= amount
183183
return _value
184184
}
185185

186186
@available(BackDeploy 1.0, *)
187-
@_backDeploy(BackDeploy 2.0)
187+
@_backDeploy(before: BackDeploy 2.0)
188188
public final func toIncrementable() -> any Incrementable { self }
189189

190190
@available(BackDeploy 1.0, *)
191-
@_backDeploy(BackDeploy 2.0)
191+
@_backDeploy(before: BackDeploy 2.0)
192192
public final subscript(byteAt index: Int) -> UInt8 { _value.byte(at: index) }
193193
}
194194

0 commit comments

Comments
 (0)