|
| 1 | +// RUN: %empty-directory(%t) |
| 2 | +// RUN: %target-swift-frontend-emit-module -emit-module-path %t/FakeDistributedActorSystems.swiftmodule -module-name FakeDistributedActorSystems -disable-availability-checking %S/../Inputs/FakeDistributedActorSystems.swift |
| 3 | + |
| 4 | +// RUN: %target-swift-frontend -Xllvm -sil-full-demangle -profile-generate -profile-coverage-mapping -emit-sorted-sil -emit-sil -module-name coverage_dist -disable-availability-checking -I %t %s | %FileCheck %s |
| 5 | +// RUN: %target-swift-frontend -profile-generate -profile-coverage-mapping -emit-ir -disable-availability-checking -I %t %s |
| 6 | + |
| 7 | +// REQUIRES: concurrency |
| 8 | +// REQUIRES: distributed |
| 9 | + |
| 10 | +import Distributed |
| 11 | +import FakeDistributedActorSystems |
| 12 | + |
| 13 | +typealias DefaultDistributedActorSystem = FakeActorSystem |
| 14 | + |
| 15 | +distributed actor MyDistActor { |
| 16 | + init(system: FakeActorSystem) { |
| 17 | + self.actorSystem = system |
| 18 | + } |
| 19 | + |
| 20 | + // CHECK-LABEL: sil hidden @$s13coverage_dist11MyDistActorCfd : $@convention(method) (@guaranteed MyDistActor) -> @owned Builtin.NativeObject |
| 21 | + // CHECK: cond_br {{%[0-9]+}}, {{bb[0-9]+}}, [[DEINITBODYBB:bb[0-9]+]] |
| 22 | + |
| 23 | + // CHECK: [[DEINITBODYBB]]: |
| 24 | + // CHECK-NEXT: string_literal utf8 |
| 25 | + // CHECK-NEXT: integer_literal $Builtin.Int64, 0 |
| 26 | + // CHECK-NEXT: integer_literal $Builtin.Int32, 2 |
| 27 | + // CHECK-NEXT: integer_literal $Builtin.Int32, 0 |
| 28 | + // CHECK-NEXT: int_instrprof_increment |
| 29 | + // CHECK: function_ref @$sSb6randomSbyFZ |
| 30 | + // CHECK: cond_br {{%[0-9]+}}, [[TRUEBB:bb[0-9]+]], {{bb[0-9]+}} |
| 31 | + |
| 32 | + // CHECK: [[TRUEBB]]: |
| 33 | + // CHECK-NEXT: string_literal utf8 |
| 34 | + // CHECK-NEXT: integer_literal $Builtin.Int64, 0 |
| 35 | + // CHECK-NEXT: integer_literal $Builtin.Int32, 2 |
| 36 | + // CHECK-NEXT: integer_literal $Builtin.Int32, 1 |
| 37 | + // CHECK-NEXT: int_instrprof_increment |
| 38 | + |
| 39 | + // CHECK-LABEL: sil_coverage_map {{.*}} "$s13coverage_dist11MyDistActorCfd" {{.*}} // coverage_dist.MyDistActor.deinit |
| 40 | + // CHECK-NEXT: [[@LINE+3]]:10 -> [[@LINE+5]]:4 : 0 |
| 41 | + // CHECK-NEXT: [[@LINE+3]]:25 -> [[@LINE+3]]:26 : 1 |
| 42 | + // CHECK-NEXT: [[@LINE+2]]:29 -> [[@LINE+2]]:30 : (0 - 1) |
| 43 | + deinit { |
| 44 | + let _ = .random() ? 0 : 1 |
| 45 | + } |
| 46 | +} |
0 commit comments