3
3
4
4
// REQUIRES: asserts
5
5
6
+ /// Build libraries.
6
7
// RUN: %target-swift-frontend -emit-module %t/HiddenLib.swift \
7
- // RUN: -enable-library-evolution \
8
+ // RUN: -enable-library-evolution -swift-version 5 \
8
9
// RUN: -emit-module-path %t/HiddenLib.swiftmodule
9
-
10
10
// RUN: %target-swift-frontend -emit-module %t/Lib.swift -I %t \
11
11
// RUN: -enable-library-evolution \
12
12
// RUN: -emit-module-path %t/Lib.swiftmodule \
13
13
// RUN: -emit-module-interface-path %t/Lib.swiftinterface
14
14
15
+ /// Build clients, with and without safety.
15
16
// RUN: %target-swift-frontend -typecheck %t/Client.swift -I %t \
16
- // RUN: -verify -Xllvm -debug-only=Serialization 2>&1 \
17
+ // RUN: -verify -Xllvm -debug-only=Serialization \
18
+ // RUN: -disable-deserialization-safety 2>&1 \
17
19
// RUN: | %FileCheck --check-prefixes=NEEDED,UNSAFE %s
18
20
19
- // RUN: rm %t/Lib.swiftmodule
21
+ // RUN: %target-swift-frontend -typecheck %t/Client.swift -I %t \
22
+ // RUN: -verify -Xllvm -debug-only=Serialization \
23
+ // RUN: -enable-deserialization-safety 2>&1 \
24
+ // RUN: | %FileCheck --check-prefixes=NEEDED,CLEAN,SAFE %s
20
25
26
+ /// Build against the swiftinterface.
27
+ // RUN: rm %t/Lib.swiftmodule
21
28
// RUN: %target-swift-frontend -typecheck %t/Client.swift -I %t \
22
- // RUN: -verify -Xllvm -debug-only=Serialization 2>&1 \
29
+ // RUN: -verify -Xllvm -debug-only=Serialization \
30
+ // RUN: -disable-deserialization-safety 2>&1 \
23
31
// RUN: | %FileCheck --check-prefixes=NEEDED,CLEAN %s
24
32
25
33
/// Decls part of the API needed by the client.
37
45
// CLEAN-NOT: Deserialized: 'privateFunc()'
38
46
// CLEAN-NOT: Deserialized: 'fileprivateFunc()'
39
47
48
+ /// Decls skips by the deserialization safety logic.
49
+ // SAFE: Skipping unsafe deserialization: 'internalFunc()'
50
+ // SAFE: Skipping unsafe deserialization: 'privateFunc()'
51
+ // SAFE: Skipping unsafe deserialization: 'fileprivateFunc()'
52
+ // SAFE: Skipping unsafe deserialization: 'refToIOI()'
53
+
40
54
//--- HiddenLib.swift
41
55
42
56
public struct HiddenStruct {
@@ -47,7 +61,7 @@ public struct HiddenStruct {
47
61
48
62
@_implementationOnly import HiddenLib
49
63
50
- public class PublicStruct {
64
+ public struct PublicStruct {
51
65
public init ( ) { }
52
66
53
67
public func publicFunc( ) { }
0 commit comments