Skip to content

Commit 2dff001

Browse files
committed
[Serialization] Update deserialization skipping test to reflect the safe behavior
1 parent 4e80111 commit 2dff001

File tree

1 file changed

+20
-6
lines changed

1 file changed

+20
-6
lines changed

test/Serialization/Safety/skip-internal-details.swift renamed to test/Serialization/Safety/skip-reading-internal-details.swift

Lines changed: 20 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,23 +3,31 @@
33

44
// REQUIRES: asserts
55

6+
/// Build libraries.
67
// RUN: %target-swift-frontend -emit-module %t/HiddenLib.swift \
7-
// RUN: -enable-library-evolution \
8+
// RUN: -enable-library-evolution -swift-version 5 \
89
// RUN: -emit-module-path %t/HiddenLib.swiftmodule
9-
1010
// RUN: %target-swift-frontend -emit-module %t/Lib.swift -I %t \
1111
// RUN: -enable-library-evolution \
1212
// RUN: -emit-module-path %t/Lib.swiftmodule \
1313
// RUN: -emit-module-interface-path %t/Lib.swiftinterface
1414

15+
/// Build clients, with and without safety.
1516
// 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 \
1719
// RUN: | %FileCheck --check-prefixes=NEEDED,UNSAFE %s
1820

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
2025

26+
/// Build against the swiftinterface.
27+
// RUN: rm %t/Lib.swiftmodule
2128
// 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 \
2331
// RUN: | %FileCheck --check-prefixes=NEEDED,CLEAN %s
2432

2533
/// Decls part of the API needed by the client.
@@ -37,6 +45,12 @@
3745
// CLEAN-NOT: Deserialized: 'privateFunc()'
3846
// CLEAN-NOT: Deserialized: 'fileprivateFunc()'
3947

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+
4054
//--- HiddenLib.swift
4155

4256
public struct HiddenStruct {
@@ -47,7 +61,7 @@ public struct HiddenStruct {
4761

4862
@_implementationOnly import HiddenLib
4963

50-
public class PublicStruct {
64+
public struct PublicStruct {
5165
public init() {}
5266

5367
public func publicFunc() {}

0 commit comments

Comments
 (0)