Skip to content

Commit 9fad1d4

Browse files
authored
Merge pull request swiftlang#22776 from gottesmm/pr-c7990910bfaec30b4804ffafba090ba42022e735
Update some tests so that they pass ownership verification.
2 parents 23f79f7 + d47c7ba commit 9fad1d4

File tree

3 files changed

+10
-3
lines changed

3 files changed

+10
-3
lines changed

test/Reflection/capture_descriptors.sil

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ extension Int: P {}
2121
sil [ossa] @concrete_callee1 : $@convention(thin) (Int, @owned <τ_0_0> { var τ_0_0 } <Int>, @thin Int.Type, @thick P.Type) -> () {
2222
bb0(%i : $Int, %b : @owned $<τ_0_0> { var τ_0_0 } <Int>, %m : $@thin Int.Type, %p : $@thick P.Type):
2323
%12 = tuple ()
24+
destroy_value %b : $<τ_0_0> { var τ_0_0 } <Int>
2425
return %12 : $()
2526
}
2627

@@ -54,6 +55,7 @@ bb0(%i : $Int, %p : $@thick P.Type):
5455
sil [ossa] @generic_callee2 : $@convention(thin) <T, U> (@in T, @owned <τ_0_0> { var τ_0_0 } <U>) -> () {
5556
bb0(%i : $*T, %b : @owned $<τ_0_0> { var τ_0_0 } <U>):
5657
%12 = tuple ()
58+
destroy_value %b : $<τ_0_0> { var τ_0_0 } <U>
5759
return %12 : $()
5860
}
5961

@@ -162,6 +164,7 @@ class GenericClass<T, U> {}
162164
sil [ossa] @generic_callee5 : $@convention(thin) <T, U, V> (@owned GenericClass<T, U>) -> () {
163165
bb0(%t : @owned $GenericClass<T, U>):
164166
%12 = tuple ()
167+
destroy_value %t : $GenericClass<T, U>
165168
return %12 : $()
166169
}
167170

@@ -205,6 +208,8 @@ sil_vtable GenericClass {}
205208
sil [ossa] @pseudogeneric_callee : $@convention(thin) @pseudogeneric <T : AnyObject, U : AnyObject> (@owned T, @owned U) -> () {
206209
bb0(%t : @owned $T, %u : @owned $U):
207210
%12 = tuple ()
211+
destroy_value %t : $T
212+
destroy_value %u : $U
208213
return %12 : $()
209214
}
210215

@@ -229,8 +234,8 @@ bb0(%thin : $@convention(thin) () -> (), %c : $@convention(c) () -> (), %block :
229234
return %12 : $()
230235
}
231236

232-
sil [ossa] @function_caller : $@convention(thin) (@convention(thin) () -> (), @convention(c) () -> (), @convention(block) () -> (), @convention(thick) () -> (), @convention(method) () -> (), @convention(witness_method: P) (Int) -> ()) -> @owned @callee_guaranteed () -> () {
233-
bb0(%thin: $@convention(thin) () -> (), %c: $@convention(c) () -> (), %block: @unowned $@convention(block) () -> (), %thick: @unowned $@convention(thick) () -> (), %method: $@convention(method) () -> (), %witness_method: $@convention(witness_method: P) (Int) -> ()):
237+
sil [ossa] @function_caller : $@convention(thin) (@convention(thin) () -> (), @convention(c) () -> (), @owned @convention(block) () -> (), @owned @convention(thick) () -> (), @convention(method) () -> (), @convention(witness_method: P) (Int) -> ()) -> @owned @callee_guaranteed () -> () {
238+
bb0(%thin: $@convention(thin) () -> (), %c: $@convention(c) () -> (), %block: @owned $@convention(block) () -> (), %thick: @owned $@convention(thick) () -> (), %method: $@convention(method) () -> (), %witness_method: $@convention(witness_method: P) (Int) -> ()):
234239
%f = function_ref @function_callee : $@convention(thin) (@convention(thin) () -> (), @convention(c) () -> (), @convention(block) () -> (), @convention(thick) () -> (), @convention(method) () -> (), @convention(witness_method: P) (Int) -> ()) -> ()
235240
%result = partial_apply [callee_guaranteed] %f(%thin, %c, %block, %thick, %method, %witness_method) : $@convention(thin) (@convention(thin) () -> (), @convention(c) () -> (), @convention(block) () -> (), @convention(thick) () -> (), @convention(method) () -> (), @convention(witness_method: P) (Int) -> ()) -> ()
236241
return %result : $@callee_guaranteed () -> ()

test/Serialization/Inputs/def_basic_objc.sil

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,8 @@ sil [transparent] [serialized] [ossa] @protocol_conversion : $@convention(thin)
4949
entry:
5050
// CHECK: {{%.*}} = objc_protocol #ObjCProto : $Protocol
5151
%p = objc_protocol #ObjCProto : $Protocol
52-
return %p : $Protocol
52+
%p_copy = copy_value %p : $Protocol
53+
return %p_copy : $Protocol
5354
}
5455

5556
@_transparent public func serialize_all() {

test/Serialization/sil_box_types.sil

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,5 +22,6 @@ sil [ossa] @boxes_extra_reqs : $@convention(thin) <T where T : Q, T.AT : P> (@ow
2222
// CHECK: bb0(%0 : $<τ_0_0 where τ_0_0 : Q, τ_0_0.AT : P> { var τ_0_0 } <T>)
2323
bb0(%0 : @owned $<τ_0_0 where τ_0_0 : Q, τ_0_0.AT : P> { var τ_0_0 } <T>):
2424
%1 = project_box %0 : $<τ_0_0 where τ_0_0 : Q, τ_0_0.AT : P> { var τ_0_0 } <T>, 0
25+
destroy_value %0 : $<τ_0_0 where τ_0_0 : Q, τ_0_0.AT : P> { var τ_0_0 } <T>
2526
return undef : $()
2627
}

0 commit comments

Comments
 (0)