1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364
|
// RUN: %empty-directory(%t)
// RUN: %target-swift-frontend-emit-module -emit-module-path %t/FakeDistributedActorSystems.swiftmodule -module-name FakeDistributedActorSystems -target %target-swift-5.7-abi-triple %S/../Inputs/FakeDistributedActorSystems.swift
// RUN: %target-swift-frontend -module-name default_deinit -primary-file %s -emit-sil -target %target-swift-5.7-abi-triple -I %t | %FileCheck %s --enable-var-scope
// REQUIRES: concurrency
// REQUIRES: distributed
// FIXME(distributed): test fails on optimized build: OSS - Swift (Tools Opt+No Assert, Stdlib Opt+DebInfo, Test Simulator) - macOS
// REQUIRES: radar97074020
// This test checks that we resign the identity for local deallocations,
// destroy only the correct stored properties whether remote or local, and also
// destroy the executor. It checks that remote actor proxies are not isolated.
// Additionally, we add basic coverage for a non-distributed actor's deinit.
import Distributed
import FakeDistributedActorSystems
typealias DefaultDistributedActorSystem = FakeActorSystem
final class SomeClass: Sendable {}
@inline(never)
private nonisolated func doIt() {}
// MARK: - Distributed actor with nonisolated deinit
distributed actor MyDistActor {
let localOnlyField: SomeClass
init(system: FakeActorSystem) {
self.actorSystem = system
self.localOnlyField = SomeClass()
}
}
// MARK: Destroying deinit
// CHECK-LABEL: // MyDistActor.deinit
// CHECK-NEXT: sil hidden{{.*}} @$s14default_deinit11MyDistActorCfd : $@convention(method) (@guaranteed MyDistActor) -> @owned Builtin.NativeObject {
// CHECK: bb0([[SELF:%[0-9]+]] : $MyDistActor):
// Resign the ID by calling actorSystem.resignID, before we destroy properties:
// CHECK: [[ID_REF:%[0-9]+]] = ref_element_addr [[SELF]] : $MyDistActor, #MyDistActor.id
// CHECK: [[SYS_REF:%[0-9]+]] = ref_element_addr [[SELF]] : $MyDistActor, #MyDistActor.actorSystem
// CHECK: [[ID_LOAD:%[0-9]+]] = load [[ID_REF]] : $*ActorAddress
// CHECK: [[SYS_LOAD:%[0-9]+]] = load [[SYS_REF]] : $*FakeActorSystem
// CHECK: [[FN_REF:%[0-9]+]] = function_ref @$s27FakeDistributedActorSystems0aC6SystemV8resignIDyyAA0C7AddressVF : $@convention(method) (@guaranteed ActorAddress, @guaranteed FakeActorSystem) -> ()
// CHECK: [[DROP:%[0-9]+]] = apply [[FN_REF]]([[ID_LOAD]], [[SYS_LOAD]]) : $@convention(method) (@guaranteed ActorAddress, @guaranteed FakeActorSystem) -> ()
// CHECK: [[DROP:%[0-9]+]] = tuple ()
// Destroy implicit Distributed Actor field: id
// CHECK: [[REF:%[0-9]+]] = ref_element_addr [[SELF]] : $MyDistActor, #MyDistActor.id
// CHECK: [[ACCESS:%[0-9]+]] = begin_access [deinit] [static] [[REF]] : $*ActorAddress
// CHECK: destroy_addr [[ACCESS]] : $*ActorAddress
// CHECK: end_access [[ACCESS]] : $*ActorAddress
// Destroy implicit Distributed Actor field: actorSystem
// CHECK: [[REF:%[0-9]+]] = ref_element_addr [[SELF]] : $MyDistActor, #MyDistActor.actorSystem
// CHECK: [[ACCESS:%[0-9]+]] = begin_access [deinit] [static] [[REF]] : $*FakeActorSystem
// CHECK: destroy_addr [[ACCESS]] : $*FakeActorSystem
// CHECK: end_access [[ACCESS]] : $*FakeActorSystem
// Destroy local fields:
// CHECK: [[REF:%[0-9]+]] = ref_element_addr [[SELF]] : $MyDistActor, #MyDistActor.localOnlyField
// CHECK: [[ACCESS:%[0-9]+]] = begin_access [deinit] [static] [[REF]] : $*SomeClass
// CHECK: destroy_addr [[ACCESS]] : $*SomeClass
// CHECK: end_access [[ACCESS]] : $*SomeClass
// CHECK: [[BUILTIN:%[0-9]+]] = builtin "destroyDefaultActor"([[SELF]] : $MyDistActor) : $()
// CHECK: [[CAST:%[0-9]+]] = unchecked_ref_cast [[SELF]] : $MyDistActor to $Builtin.NativeObject
// CHECK: return [[CAST]] : $Builtin.NativeObject
// CHECK: } // end sil function '$s14default_deinit11MyDistActorCfd'
// MARK: Isolated deallocating deinit
// ===== -----------------------------------------------------------------------
// CHECK-NOT: MyDistActor.__isolated_deallocating_deinit
// CHECK-NOT: @$s14default_deinit11MyDistActorCfZ
// MARK: Deallocating deinit
// ===== -----------------------------------------------------------------------
// CHECK-LABEL: MyDistActor.__deallocating_deinit
// CHECK-NEXT: sil hidden @$s14default_deinit11MyDistActorCfD : $@convention(method) (@owned MyDistActor) -> () {
// CHECK: bb0([[SELF:%[0-9]+]] : $MyDistActor):
// CHECK: [[EXI_SELF:%[0-9]+]] = init_existential_ref [[SELF]] : $MyDistActor : $MyDistActor, $AnyObject
// CHECK: [[IS_REMOTE_FN:%[0-9]+]] = function_ref @swift_distributed_actor_is_remote : $@convention(thin) (@guaranteed AnyObject) -> Bool
// CHECK: [[IS_REMOTE:%[0-9]+]] = apply [[IS_REMOTE_FN]]([[EXI_SELF]])
// CHECK: [[RAW_BOOL:%[0-9]+]] = struct_extract [[IS_REMOTE]] : $Bool, #Bool._value
// CHECK: cond_br [[RAW_BOOL]], [[REMOTE_ACTOR_DEINIT_BB:bb[0-9]+]], [[LOCAL_ACTOR_DEINIT_BB:bb[0-9]+]]
// ===== -----------------------------------------------------------------------
// CHECK: // localActorDeinitBB
// CHECK: [[LOCAL_ACTOR_DEINIT_BB]]:
// CHECK: [[DESTROYER_REF:%[0-9]+]] = function_ref @$s14default_deinit11MyDistActorCfd : $@convention(method) (@guaranteed MyDistActor) -> @owned Builtin.NativeObject
// CHECK: [[UNTYPED_DESTOY_RESULT:%[0-9]+]] = apply [[DESTROYER_REF]]([[SELF]]) : $@convention(method) (@guaranteed MyDistActor) -> @owned Builtin.NativeObject
// CHECK: [[TYPED_DESTOY_RESULT:%[0-9]+]] = unchecked_ref_cast [[UNTYPED_DESTOY_RESULT]] : $Builtin.NativeObject to $MyDistActor
// CHECK: dealloc_ref [[TYPED_DESTOY_RESULT]] : $MyDistActor
// CHECK: br [[FINISH_DEINIT_BB:bb[0-9]+]]
// ===== -----------------------------------------------------------------------
// CHECK: // finishDeinitBB
// CHECK: [[FINISH_DEINIT_BB]]:
// CHECK: [[RESULT:%[0-9]+]] = tuple ()
// CHECK: return [[RESULT]] : $()
// ===== -----------------------------------------------------------------------
// CHECK: // remoteActorDeinitBB
// CHECK: [[REMOTE_ACTOR_DEINIT_BB]]:
// Even just the remote deinit branch must destroy the ID
// CHECK: [[REF:%[0-9]+]] = ref_element_addr [[SELF]] : $MyDistActor, #MyDistActor.id
// CHECK: [[ACCESS:%[0-9]+]] = begin_access [deinit] [static] [[REF]] : $*ActorAddress
// CHECK: destroy_addr [[ACCESS]] : $*ActorAddress
// CHECK: end_access [[ACCESS]] : $*ActorAddress
// As well as the actor system:
// CHECK: [[REF:%[0-9]+]] = ref_element_addr [[SELF]] : $MyDistActor, #MyDistActor.actorSystem
// CHECK: [[ACCESS:%[0-9]+]] = begin_access [deinit] [static] [[REF]] : $*FakeActorSystem
// CHECK: destroy_addr [[ACCESS]] : $*FakeActorSystem
// CHECK: end_access [[ACCESS]] : $*FakeActorSystem
// Destroy default actor implementation
// CHECK: [[BUILTIN:%[0-9]+]] = builtin "destroyDefaultActor"([[SELF]] : $MyDistActor) : $()
// And deallocate the proxy
// CHECK: dealloc_ref [[SELF]] : $MyDistActor
// Return
// CHECK: br [[FINISH_DEINIT_BB]]
// CHECK: } // end sil function '$s14default_deinit11MyDistActorCfD'
// ===== -----------------------------------------------------------------------
// MARK: - Distributed actor with isolated deinit
distributed actor MyDistActorIsolated {
let localOnlyField: SomeClass
init(system: FakeActorSystem) {
self.actorSystem = system
self.localOnlyField = SomeClass()
}
deinit {
doIt()
}
}
// MARK: Destroying deinit
// CHECK-LABEL: // MyDistActorIsolated.deinit
// CHECK-NEXT: sil hidden{{.*}} @$s14default_deinit19MyDistActorIsolatedCfd : $@convention(method) (@guaranteed MyDistActorIsolated) -> @owned Builtin.NativeObject {
// CHECK: bb0([[SELF:%[0-9]+]] : $MyDistActorIsolated):
// Resign the ID by calling actorSystem.resignID, before we destroy properties:
// CHECK: [[ID_REF:%[0-9]+]] = ref_element_addr [[SELF]] : $MyDistActorIsolated, #MyDistActorIsolated.id
// CHECK: [[SYS_REF:%[0-9]+]] = ref_element_addr [[SELF]] : $MyDistActorIsolated, #MyDistActorIsolated.actorSystem
// CHECK: [[ID_LOAD:%[0-9]+]] = load [[ID_REF]] : $*ActorAddress
// CHECK: [[SYS_LOAD:%[0-9]+]] = load [[SYS_REF]] : $*FakeActorSystem
// CHECK: [[FN_REF:%[0-9]+]] = function_ref @$s27FakeDistributedActorSystems0aC6SystemV8resignIDyyAA0C7AddressVF : $@convention(method) (@guaranteed ActorAddress, @guaranteed FakeActorSystem) -> ()
// CHECK: [[DROP:%[0-9]+]] = apply [[FN_REF]]([[ID_LOAD]], [[SYS_LOAD]]) : $@convention(method) (@guaranteed ActorAddress, @guaranteed FakeActorSystem) -> ()
// CHECK: [[DROP:%[0-9]+]] = tuple ()
// Destroy implicit Distributed Actor field: id
// CHECK: [[REF:%[0-9]+]] = ref_element_addr [[SELF]] : $MyDistActorIsolated, #MyDistActorIsolated.id
// CHECK: [[ACCESS:%[0-9]+]] = begin_access [deinit] [static] [[REF]] : $*ActorAddress
// CHECK: destroy_addr [[ACCESS]] : $*ActorAddress
// CHECK: end_access [[ACCESS]] : $*ActorAddress
// Destroy implicit Distributed Actor field: actorSystem
// CHECK: [[REF:%[0-9]+]] = ref_element_addr [[SELF]] : $MyDistActorIsolated, #MyDistActorIsolated.actorSystem
// CHECK: [[ACCESS:%[0-9]+]] = begin_access [deinit] [static] [[REF]] : $*FakeActorSystem
// CHECK: destroy_addr [[ACCESS]] : $*FakeActorSystem
// CHECK: end_access [[ACCESS]] : $*FakeActorSystem
// Destroy local fields:
// CHECK: [[REF:%[0-9]+]] = ref_element_addr [[SELF]] : $MyDistActorIsolated, #MyDistActorIsolated.localOnlyField
// CHECK: [[ACCESS:%[0-9]+]] = begin_access [deinit] [static] [[REF]] : $*SomeClass
// CHECK: destroy_addr [[ACCESS]] : $*SomeClass
// CHECK: end_access [[ACCESS]] : $*SomeClass
// CHECK: [[BUILTIN:%[0-9]+]] = builtin "destroyDefaultActor"([[SELF]] : $MyDistActorIsolated) : $()
// CHECK: [[CAST:%[0-9]+]] = unchecked_ref_cast [[SELF]] : $MyDistActorIsolated to $Builtin.NativeObject
// CHECK: return [[CAST]] : $Builtin.NativeObject
// CHECK: } // end sil function '$s14default_deinit19MyDistActorIsolatedCfd'
// MARK: Isolated deallocating deinit
// ===== -----------------------------------------------------------------------
// CHECK-LABEL: MyDistActorIsolated.__isolated_deallocating_deinit
// CHECK-NEXT: sil hidden @$s14default_deinit19MyDistActorIsolatedCfZ : $@convention(thin) (@owned MyDistActorIsolated) -> () {
// CHECK: bb0([[SELF:%[0-9]+]] : $MyDistActorIsolated):
// CHECK: [[DESTROYER_REF:%[0-9]+]] = function_ref @$s14default_deinit19MyDistActorIsolatedCfd : $@convention(method) (@guaranteed MyDistActorIsolated) -> @owned Builtin.NativeObject
// CHECK: [[UNTYPED_DESTOY_RESULT:%[0-9]+]] = apply [[DESTROYER_REF]]([[SELF]]) : $@convention(method) (@guaranteed MyDistActorIsolated) -> @owned Builtin.NativeObject
// CHECK: [[TYPED_DESTOY_RESULT:%[0-9]+]] = unchecked_ref_cast [[UNTYPED_DESTOY_RESULT]] : $Builtin.NativeObject to $MyDistActorIsolated
// CHECK: dealloc_ref [[TYPED_DESTOY_RESULT]] : $MyDistActorIsolated
// CHECK: [[RESULT:%[0-9]+]] = tuple ()
// CHECK: return [[RESULT]] : $()
// CHECK: } // end sil function '$s14default_deinit19MyDistActorIsolatedCfZ'
// MARK: Deallocating deinit
// ===== -----------------------------------------------------------------------
// CHECK-LABEL: MyDistActorIsolated.__deallocating_deinit
// CHECK-NEXT: sil hidden @$s14default_deinit19MyDistActorIsolatedCfD : $@convention(method) (@owned MyDistActorIsolated) -> () {
// CHECK: bb0([[SELF:%[0-9]+]] : $MyDistActorIsolated):
// CHECK: [[EXI_SELF:%[0-9]+]] = init_existential_ref [[SELF]] : $MyDistActorIsolated : $MyDistActorIsolated, $AnyObject
// CHECK: [[IS_REMOTE_FN:%[0-9]+]] = function_ref @swift_distributed_actor_is_remote : $@convention(thin) (@guaranteed AnyObject) -> Bool
// CHECK: [[IS_REMOTE:%[0-9]+]] = apply [[IS_REMOTE_FN]]([[EXI_SELF]])
// CHECK: [[RAW_BOOL:%[0-9]+]] = struct_extract [[IS_REMOTE]] : $Bool, #Bool._value
// CHECK: cond_br [[RAW_BOOL]], [[REMOTE_ACTOR_DEINIT_BB:bb[0-9]+]], [[LOCAL_ACTOR_DEINIT_BB:bb[0-9]+]]
// ===== -----------------------------------------------------------------------
// CHECK: // localActorDeinitBB
// CHECK: [[LOCAL_ACTOR_DEINIT_BB]]:
// CHECK: [[ISOLATED_REF:%[0-9]+]] = function_ref @$s14default_deinit19MyDistActorIsolatedCfZ : $@convention(thin) (@owned MyDistActorIsolated) -> ()
// CHECK: [[EXECUTOR:%[0-9]+]] = extract_executor [[SELF]] : $MyDistActorIsolated
// CHECK: [[PERFORM_REF:%[0-9]+]] = function_ref @swift_task_deinitOnExecutor : $@convention(thin) (@owned AnyObject, @convention(thin) (@owned AnyObject) -> (), Builtin.Executor) -> ()
// CHECK: [[SELF_AS_ANY_OBJECT:%[0-9]+]] = unchecked_bitwise_cast [[SELF]] : $MyDistActorIsolated to $AnyObject
// CHECK: [[ISOLATED_CASTED:%[0-9]+]] = convert_function [[ISOLATED_REF]] : $@convention(thin) (@owned MyDistActorIsolated) -> () to $@convention(thin) (@owned AnyObject) -> ()
// CHECK: [[DROP:%[0-9]+]] = apply [[PERFORM_REF]]([[SELF_AS_ANY_OBJECT]], [[ISOLATED_CASTED]], [[EXECUTOR]]) : $@convention(thin) (@owned AnyObject, @convention(thin) (@owned AnyObject) -> (), Builtin.Executor) -> ()
// CHECK: br [[FINISH_DEINIT_BB:bb[0-9]+]]
// ===== -----------------------------------------------------------------------
// CHECK: // finishDeinitBB
// CHECK: [[FINISH_DEINIT_BB]]:
// CHECK: [[RESULT:%[0-9]+]] = tuple ()
// CHECK: return [[RESULT]] : $()
// ===== -----------------------------------------------------------------------
// CHECK: // remoteActorDeinitBB
// CHECK: [[REMOTE_ACTOR_DEINIT_BB]]:
// Even just the remote deinit branch must destroy the ID
// CHECK: [[REF:%[0-9]+]] = ref_element_addr [[SELF]] : $MyDistActorIsolated, #MyDistActorIsolated.id
// CHECK: [[ACCESS:%[0-9]+]] = begin_access [deinit] [static] [[REF]] : $*ActorAddress
// CHECK: destroy_addr [[ACCESS]] : $*ActorAddress
// CHECK: end_access [[ACCESS]] : $*ActorAddress
// As well as the actor system:
// CHECK: [[REF:%[0-9]+]] = ref_element_addr [[SELF]] : $MyDistActorIsolated, #MyDistActorIsolated.actorSystem
// CHECK: [[ACCESS:%[0-9]+]] = begin_access [deinit] [static] [[REF]] : $*FakeActorSystem
// CHECK: destroy_addr [[ACCESS]] : $*FakeActorSystem
// CHECK: end_access [[ACCESS]] : $*FakeActorSystem
// Destroy default actor implementation
// CHECK: [[BUILTIN:%[0-9]+]] = builtin "destroyDefaultActor"([[SELF]] : $MyDistActorIsolated) : $()
// And deallocate the proxy
// CHECK: dealloc_ref [[SELF]] : $MyDistActorIsolated
// Return
// CHECK: br [[FINISH_DEINIT_BB]]
// CHECK: } // end sil function '$s14default_deinit19MyDistActorIsolatedCfD'
// ===== -----------------------------------------------------------------------
// MARK: - Local actor with nonisolated deinit
@available(macOS 12, *)
actor SimpleActor {
let someField: SomeClass
init() {
self.someField = SomeClass()
}
}
// MARK: Destroying deinit
// ===== -----------------------------------------------------------------------
// CHECK-LABEL: // SimpleActor.deinit
// CHECK-NEXT: sil hidden{{.*}} @$s14default_deinit11SimpleActorCfd : $@convention(method) (@guaranteed SimpleActor) -> @owned Builtin.NativeObject {
// CHECK: bb0([[SELF:%[0-9]+]] : $SimpleActor):
// CHECK: [[REF:%[0-9]+]] = ref_element_addr [[SELF]] : $SimpleActor, #SimpleActor.someField
// CHECK: [[ACCESS:%[0-9]+]] = begin_access [deinit] [static] [[REF]]
// CHECK: destroy_addr [[ACCESS]] : $*SomeClass
// CHECK: end_access [[ACCESS]]
// CHECK: builtin "destroyDefaultActor"([[SELF]] : $SimpleActor)
// CHECK: [[CAST:%[0-9]+]] = unchecked_ref_cast [[SELF]]
// CHECK: return [[CAST]] : $Builtin.NativeObject
// CHECK: } // end sil function '$s14default_deinit11SimpleActorCfd'
// MARK: Isolated deallocating deinit
// ===== -----------------------------------------------------------------------
// CHECK-NOT: SimpleActor.__isolated_deallocating_deinit
// CHECK-NOT: @$s14default_deinit11SimpleActorCfZ
// MARK: Deallocating deinit
// ===== -----------------------------------------------------------------------
// CHECK-LABEL: // SimpleActor.__deallocating_deinit
// CHECK-NEXT: sil hidden{{.*}} @$s14default_deinit11SimpleActorCfD : $@convention(method) (@owned SimpleActor) -> () {
// CHECK: bb0([[SELF:%[0-9]+]] : $SimpleActor):
// CHECK: [[DESTROYER_REF:%[0-9]+]] = function_ref @$s14default_deinit11SimpleActorCfd : $@convention(method) (@guaranteed SimpleActor) -> @owned Builtin.NativeObject
// CHECK: [[UNTYPED_DESTOY_RESULT:%[0-9]+]] = apply [[DESTROYER_REF]]([[SELF]]) : $@convention(method) (@guaranteed SimpleActor) -> @owned Builtin.NativeObject
// CHECK: [[TYPED_DESTOY_RESULT:%[0-9]+]] = unchecked_ref_cast [[UNTYPED_DESTOY_RESULT]] : $Builtin.NativeObject to $SimpleActor
// CHECK: dealloc_ref [[TYPED_DESTOY_RESULT]] : $SimpleActor
// CHECK: [[RESULT:%[0-9]+]] = tuple ()
// CHECK: return [[RESULT]] : $()
// CHECK: } // end sil function '$s14default_deinit11SimpleActorCfD'
// MARK: - Local actor with nonisolated deinit
@available(macOS 12, *)
actor SimpleActorIsolated {
let someField: SomeClass
init() {
self.someField = SomeClass()
}
deinit {
doIt()
}
}
// MARK: Destroying deinit
// ===== -----------------------------------------------------------------------
// CHECK-LABEL: // SimpleActorIsolated.deinit
// CHECK-NEXT: sil hidden{{.*}} @$s14default_deinit19SimpleActorIsolatedCfd : $@convention(method) (@guaranteed SimpleActorIsolated) -> @owned Builtin.NativeObject {
// CHECK: bb0([[SELF:%[0-9]+]] : $SimpleActorIsolated):
// CHECK: [[REF:%[0-9]+]] = ref_element_addr [[SELF]] : $SimpleActorIsolated, #SimpleActorIsolated.someField
// CHECK: [[ACCESS:%[0-9]+]] = begin_access [deinit] [static] [[REF]]
// CHECK: destroy_addr [[ACCESS]] : $*SomeClass
// CHECK: end_access [[ACCESS]]
// CHECK: builtin "destroyDefaultActor"([[SELF]] : $SimpleActorIsolated)
// CHECK: [[CAST:%[0-9]+]] = unchecked_ref_cast [[SELF]]
// CHECK: return [[CAST]] : $Builtin.NativeObject
// CHECK: } // end sil function '$s14default_deinit19SimpleActorIsolatedCfd'
// MARK: Isolated deallocating deinit
// ===== -----------------------------------------------------------------------
// CHECK-LABEL: // SimpleActorIsolated.__isolated_deallocating_deinit
// CHECK-NEXT: sil hidden{{.*}} @$s14default_deinit19SimpleActorIsolatedCfZ : $@convention(thin) (@owned SimpleActorIsolated) -> () {
// CHECK: bb0([[SELF:%[0-9]+]] : $SimpleActorIsolated):
// CHECK: [[DESTROYER_REF:%[0-9]+]] = function_ref @$s14default_deinit19SimpleActorIsolatedCfd : $@convention(method) (@guaranteed SimpleActorIsolated) -> @owned Builtin.NativeObject
// CHECK: [[UNTYPED_DESTOY_RESULT:%[0-9]+]] = apply [[DESTROYER_REF]]([[SELF]]) : $@convention(method) (@guaranteed SimpleActorIsolated) -> @owned Builtin.NativeObject
// CHECK: [[TYPED_DESTOY_RESULT:%[0-9]+]] = unchecked_ref_cast [[UNTYPED_DESTOY_RESULT]] : $Builtin.NativeObject to $SimpleActorIsolated
// CHECK: dealloc_ref [[TYPED_DESTOY_RESULT]] : $SimpleActorIsolated
// CHECK: [[RESULT:%[0-9]+]] = tuple ()
// CHECK: return [[RESULT]] : $()
// CHECK: } // end sil function '$s14default_deinit19SimpleActorIsolatedCfZ'
// MARK: Deallocating deinit
// ===== -----------------------------------------------------------------------
// CHECK-LABEL: // SimpleActorIsolated.__deallocating_deinit
// CHECK-NEXT: sil hidden{{.*}} @$s14default_deinit19SimpleActorIsolatedCfD : $@convention(method) (@owned SimpleActorIsolated) -> () {
// CHECK: bb0([[SELF:%[0-9]+]] : $SimpleActorIsolated):
// CHECK: [[ISOLATED_REF:%[0-9]+]] = function_ref @$s14default_deinit19SimpleActorIsolatedCfZ : $@convention(thin) (@owned SimpleActorIsolated) -> ()
// CHECK: [[EXECUTOR:%[0-9]+]] = extract_executor [[SELF]] : $SimpleActorIsolated
// CHECK: [[PERFORM_REF:%[0-9]+]] = function_ref @swift_task_deinitOnExecutor : $@convention(thin) (@owned AnyObject, @convention(thin) (@owned AnyObject) -> (), Builtin.Executor) -> ()
// CHECK: [[SELF_AS_ANY_OBJECT:%[0-9]+]] = unchecked_bitwise_cast [[SELF]] : $SimpleActorIsolated to $AnyObject
// CHECK: [[ISOLATED_CASTED:%[0-9]+]] = convert_function [[ISOLATED_REF]] : $@convention(thin) (@owned SimpleActorIsolated) -> () to $@convention(thin) (@owned AnyObject) -> ()
// CHECK: [[DROP:%[0-9]+]] = apply [[PERFORM_REF]]([[SELF_AS_ANY_OBJECT]], [[ISOLATED_CASTED]], [[EXECUTOR]]) : $@convention(thin) (@owned AnyObject, @convention(thin) (@owned AnyObject) -> (), Builtin.Executor) -> ()
// CHECK: [[RESULT:%[0-9]+]] = tuple ()
// CHECK: return [[RESULT]] : $()
// CHECK: } // end sil function '$s14default_deinit19SimpleActorIsolatedCfD'
|