5
5
// RUN: %empty-directory(%t)
6
6
// RUN: split-file %s %t
7
7
8
- // RUN: %target-build-swift -enable-library-evolution -target %target-cpu-apple-macosx13.0 -parse-as-library -emit-library -emit-module-path %t/Library.swiftmodule -module-name Library %t/library.swift -o %t/%target-library-name(Library)
9
- // RUN: %target-build-swift -enable-library-evolution -target %target-cpu-apple-macosx13.0 -parse-as-library -lLibrary -module-name main -I %t -L %t %t/main.swift -o %t/a.out
8
+ // RUN: %target-build-swift -Xfrontend -validate-tbd-against-ir=none -enable-library-evolution -target %target-cpu-apple-macosx13.0 -parse-as-library -emit-library -emit-module-path %t/Library.swiftmodule -module-name Library %t/library.swift -o %t/%target-library-name(Library)
9
+
10
+ // RUN: %target-build-swift -Xfrontend -validate-tbd-against-ir=none -enable-library-evolution -target %target-cpu-apple-macosx13.0 -parse-as-library %t/library.swift -module-name Library -emit-irgen -o /tmp/irgen-evo
11
+ // RUN: %target-build-swift -Xfrontend -validate-tbd-against-ir=none -enable-library-evolution -target %target-cpu-apple-macosx13.0 -parse-as-library %t/library.swift -module-name Library -emit-ir -o /tmp/ir-evo
12
+ // RUN: %target-build-swift -Xfrontend -validate-tbd-against-ir=none -enable-library-evolution -target %target-cpu-apple-macosx13.0 -parse-as-library %t/library.swift -module-name Library -emit-sil -o /tmp/sil-evo
13
+ // RUN: %target-build-swift -Xfrontend -validate-tbd-against-ir=none -enable-library-evolution -target %target-cpu-apple-macosx13.0 -parse-as-library %t/library.swift -module-name Library -emit-silgen -o /tmp/silgen-evo
14
+
15
+ // RUN: %target-build-swift -Xfrontend -validate-tbd-against-ir=none -target %target-cpu-apple-macosx13.0 -parse-as-library %t/library.swift -module-name Library -emit-irgen -o /tmp/irgen-noevo
16
+ // RUN: %target-build-swift -Xfrontend -validate-tbd-against-ir=none -target %target-cpu-apple-macosx13.0 -parse-as-library %t/library.swift -module-name Library -emit-ir -o /tmp/ir-noevo
17
+ // RUN: %target-build-swift -Xfrontend -validate-tbd-against-ir=none -target %target-cpu-apple-macosx13.0 -parse-as-library %t/library.swift -module-name Library -emit-sil -o /tmp/sil-noevo
18
+ // RUN: %target-build-swift -Xfrontend -validate-tbd-against-ir=none -target %target-cpu-apple-macosx13.0 -parse-as-library %t/library.swift -module-name Library -emit-silgen -o /tmp/silgen-noevo
19
+
20
+ // RUN: %target-build-swift -Xfrontend -validate-tbd-against-ir=none -enable-library-evolution -target %target-cpu-apple-macosx13.0 -parse-as-library -lLibrary -module-name main -I %t -L %t %t/main.swift -emit-irgen -o /tmp/app-irgen-evo
21
+ // RUN: %target-build-swift -Xfrontend -validate-tbd-against-ir=none -target %target-cpu-apple-macosx13.0 -parse-as-library -lLibrary -module-name main -I %t -L %t %t/main.swift -emit-irgen -o /tmp/app-irgen-noevo
22
+
23
+ // RUN: %target-build-swift -Xfrontend -validate-tbd-against-ir=none -target %target-cpu-apple-macosx13.0 -parse-as-library -lLibrary -module-name main -I %t -L %t %t/main.swift -o %t/a.out
24
+
25
+
10
26
// RUN: %target-codesign %t/a.out
11
27
// RUN: %target-run %t/a.out
12
28
13
29
//--- library.swift
14
30
import Distributed
15
31
32
+ //public protocol NormalProtocol {
33
+ // func NORMAL() async -> Int
34
+ //}
35
+
16
36
public protocol SimpleProtocol : DistributedActor
17
37
where ActorSystem == LocalTestingDistributedActorSystem {
18
38
39
+ // nonisolated override var id: ID { get } // comes from DistributedActor
40
+
19
41
// Has to have a distributed method to fail
20
42
distributed func test( ) -> Int
21
43
}
22
44
23
-
24
45
//--- main.swift
25
46
import Distributed
26
47
import Library
27
48
49
+ //actor NormalActor: NormalProtocol {
50
+ // func NORMAL() async -> Int { 1 }
51
+ //}
52
+
28
53
public distributed actor SimpleActor : SimpleProtocol {
29
- public distributed func test( ) -> Int {
30
- 1
31
- }
54
+ public distributed func test( ) -> Int { 1 }
32
55
}
33
56
34
57
// Passes
35
- public func makeFromPass< Act> ( _ act: Act ) where Act : DistributedActor {
58
+ public func makeFromPass< Act: DistributedActor > ( _ act: Act ) {
36
59
print ( act. id)
37
60
}
38
61
39
62
// Fails
40
- public func makeFromFail< Act> ( _ act: Act ) where Act : SimpleProtocol {
63
+ public func makeFromFail< Act: SimpleProtocol > ( _ act: Act ) async {
41
64
print ( act. id)
65
+ try ! await print ( act. test ( ) )
42
66
}
43
67
44
68
@main
45
69
struct TestSwiftFrameworkTests {
46
- static func main( ) {
70
+ static func main( ) async {
47
71
let system = LocalTestingDistributedActorSystem ( )
48
72
73
+ // let norm = NormalActor()
74
+
49
75
let simpleActor = SimpleActor ( actorSystem: system)
50
- makeFromPass ( simpleActor)
76
+ // makeFromPass(simpleActor)
51
77
52
- makeFromFail ( simpleActor)
78
+ await makeFromFail ( simpleActor)
53
79
}
54
80
}
0 commit comments