File tree Expand file tree Collapse file tree 6 files changed +29
-6
lines changed
test/Serialization/Safety Expand file tree Collapse file tree 6 files changed +29
-6
lines changed Original file line number Diff line number Diff line change @@ -366,7 +366,8 @@ namespace swift {
366
366
367
367
// / Enable early skipping deserialization of decls that are marked as
368
368
// / unsafe to read.
369
- bool EnableDeserializationSafety = true ;
369
+ bool EnableDeserializationSafety =
370
+ ::getenv (" SWIFT_ENABLE_DESERIALIZATION_SAFETY" );
370
371
371
372
// / Whether to enable the new operator decl and precedencegroup lookup
372
373
// / behavior. This is a staging flag, and will be removed in the future.
Original file line number Diff line number Diff line change 10
10
// RUN: -emit-module-interface-path %t/Lib.swiftinterface
11
11
12
12
/// Build against the swiftmodule.
13
- // RUN: %target-swift-frontend -typecheck %t/Client.swift -I %t
13
+ // RUN: %target-swift-frontend -typecheck %t/Client.swift -I %t \
14
+ // RUN: -enable-deserialization-safety
14
15
15
16
/// Build against the swiftinterface.
16
17
// RUN: rm %t/Lib.swiftmodule
17
- // RUN: %target-swift-frontend -typecheck %t/Client.swift -I %t
18
+ // RUN: %target-swift-frontend -typecheck %t/Client.swift -I %t \
19
+ // RUN: -enable-deserialization-safety
18
20
19
21
//--- Lib.swift
20
22
Original file line number Diff line number Diff line change 11
11
12
12
/// Build client.
13
13
// RUN: %target-swift-frontend -typecheck %t/Client.swift -I %t \
14
- // RUN: -verify -Xllvm -debug-only=Serialization 2>&1 \
14
+ // RUN: -verify -Xllvm -debug-only=Serialization \
15
+ // RUN: -enable-deserialization-safety 2>&1 \
15
16
// RUN: | %FileCheck --check-prefixes=SAFE %s
16
17
17
18
/// Decls skips by the deserialization safety logic.
Original file line number Diff line number Diff line change 19
19
// RUN: | %FileCheck --check-prefixes=NEEDED,UNSAFE %s
20
20
21
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
25
+
26
+ /// Disabled by default.
27
+ // RUN: %target-swift-frontend -typecheck %t/Client.swift -I %t \
28
+ // RUN: -verify -Xllvm -debug-only=Serialization \
29
+ // RUN: -disable-deserialization-safety 2>&1 \
30
+ // RUN: | %FileCheck --check-prefixes=NEEDED,UNSAFE %s
31
+
32
+ /// Enable with env var.
33
+ // RUN: env SWIFT_ENABLE_DESERIALIZATION_SAFETY=true \
34
+ // RUN: %target-swift-frontend -typecheck %t/Client.swift -I %t \
22
35
// RUN: -verify -Xllvm -debug-only=Serialization 2>&1 \
23
36
// RUN: | %FileCheck --check-prefixes=NEEDED,CLEAN,SAFE %s
24
37
Original file line number Diff line number Diff line change 4
4
5
5
// RUN: %target-swift-frontend -emit-module %s \
6
6
// RUN: -enable-library-evolution -swift-version 5 \
7
+ // RUN: -enable-deserialization-safety \
7
8
// RUN: -Xllvm -debug-only=Serialization 2>&1 | %swift-demangle --simplified \
8
9
// RUN: | %FileCheck --check-prefixes=SAFETY-PRIVATE,SAFETY-INTERNAL %s
9
10
10
11
// RUN: %target-swift-frontend -emit-module %s \
11
12
// RUN: -enable-library-evolution -swift-version 5 \
13
+ // RUN: -enable-deserialization-safety \
12
14
// RUN: -Xllvm -debug-only=Serialization \
13
15
// RUN: -enable-testing 2>&1 \
14
16
// RUN: | %FileCheck --check-prefixes=DISABLED %s
15
17
16
18
/// Don't mark decls as unsafe when private import is enabled.
17
19
// RUN: %target-swift-frontend -emit-module %s \
18
20
// RUN: -enable-library-evolution -swift-version 5 \
21
+ // RUN: -enable-deserialization-safety \
19
22
// RUN: -Xllvm -debug-only=Serialization \
20
23
// RUN: -enable-private-imports 2>&1 \
21
24
// RUN: | %FileCheck --check-prefixes=DISABLED %s
22
25
23
26
/// Don't mark decls as unsafe without library evolution.
24
27
// RUN: %target-swift-frontend -emit-module %s \
25
- // RUN: -swift-version 5 \
28
+ // RUN: -enable-deserialization-safety - swift-version 5 \
26
29
// RUN: -Xllvm -debug-only=Serialization 2>&1 \
27
30
// RUN: | %FileCheck --check-prefixes=DISABLED %s
28
31
Original file line number Diff line number Diff line change 4
4
5
5
// RUN: %target-swift-frontend -emit-module %s \
6
6
// RUN: -enable-library-evolution -swift-version 5 \
7
+ // RUN: -enable-deserialization-safety \
7
8
// RUN: -Xllvm -debug-only=Serialization 2>&1 \
8
9
// RUN: | %FileCheck --check-prefixes=SAFETY-PRIVATE,SAFETY-INTERNAL %s
9
10
10
11
// RUN: %target-swift-frontend -emit-module %s \
11
12
// RUN: -enable-library-evolution -swift-version 5 \
13
+ // RUN: -enable-deserialization-safety \
12
14
// RUN: -Xllvm -debug-only=Serialization \
13
15
// RUN: -enable-testing 2>&1 \
14
16
// RUN: | %FileCheck --check-prefixes=DISABLED %s
15
17
16
18
/// Don't mark decls as unsafe when private import is enabled.
17
19
// RUN: %target-swift-frontend -emit-module %s \
18
20
// RUN: -enable-library-evolution -swift-version 5 \
21
+ // RUN: -enable-deserialization-safety \
19
22
// RUN: -Xllvm -debug-only=Serialization \
20
23
// RUN: -enable-private-imports 2>&1 \
21
24
// RUN: | %FileCheck --check-prefixes=DISABLED %s
22
25
23
26
/// Don't mark decls as unsafe without library evolution.
24
27
// RUN: %target-swift-frontend -emit-module %s \
25
- // RUN: -swift-version 5 \
28
+ // RUN: -enable-deserialization-safety - swift-version 5 \
26
29
// RUN: -Xllvm -debug-only=Serialization 2>&1 \
27
30
// RUN: | %FileCheck --check-prefixes=DISABLED %s
28
31
You can’t perform that action at this time.
0 commit comments