Files
swift-mirror/test/Distributed/SIL/distributed_actor_initialize_nondefault.swift
Allan Shortlidge 941ac3c097 Distributed: Enabled availability checking in Distributed tests.
Various distributed actors test cases were testing behavior that ultimately
depends on availability checking but then disabled availability checking on the
command line when building. This will break with future planned changes to
availability checking infrastructure.
2023-11-08 20:56:04 -08:00

29 lines
1.4 KiB
Swift

// RUN: %empty-directory(%t)
// RUN: %target-swift-frontend-emit-module -emit-module-path %t/FakeDistributedActorSystems.swiftmodule -module-name FakeDistributedActorSystems %S/../Inputs/FakeDistributedActorSystems.swift
// RUN: %target-swift-frontend -module-name default_deinit -primary-file %s -emit-sil -verify -I %t | %FileCheck %s --enable-var-scope
// REQUIRES: concurrency
// REQUIRES: distributed
/// The convention in this test is that the Swift declaration comes before its FileCheck lines.
import Distributed
import FakeDistributedActorSystems
@available(SwiftStdlib 5.7, *)
typealias DefaultDistributedActorSystem = FakeRoundtripActorSystem
// ==== ----------------------------------------------------------------------------------------------------------------
@available(SwiftStdlib 5.9, *)
distributed actor MyDistActor {
nonisolated var unownedExecutor: UnownedSerialExecutor {
return MainActor.sharedUnownedExecutor
}
// // MyDistActor.init(actorSystem:)
// CHECK: sil hidden{{.*}} @$s14default_deinit11MyDistActorC11actorSystemAC015FakeDistributedE7Systems0h9RoundtripeG0C_tcfc : $@convention(method) (@owned FakeRoundtripActorSystem, @owned MyDistActor) -> @owned MyDistActor
// CHECK-NOT: {{%[0-9]+}} = builtin "initializeDefaultActor"(%1 : $MyDistActor) : $()
// CHECK: [[ACTOR_INSTANCE:%[0-9]+]] = builtin "initializeNonDefaultDistributedActor"(%1 : $MyDistActor) : $()
}