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 {
366366
367367 // / Enable early skipping deserialization of decls that are marked as
368368 // / unsafe to read.
369- bool EnableDeserializationSafety = true ;
369+ bool EnableDeserializationSafety =
370+ ::getenv (" SWIFT_ENABLE_DESERIALIZATION_SAFETY" );
370371
371372 // / Whether to enable the new operator decl and precedencegroup lookup
372373 // / behavior. This is a staging flag, and will be removed in the future.
Original file line number Diff line number Diff line change 1010// RUN: -emit-module-interface-path %t/Lib.swiftinterface
1111
1212/// 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
1415
1516/// Build against the swiftinterface.
1617// 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
1820
1921//--- Lib.swift
2022
Original file line number Diff line number Diff line change 1111
1212/// Build client.
1313// 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 \
1516// RUN: | %FileCheck --check-prefixes=SAFE %s
1617
1718/// Decls skips by the deserialization safety logic.
Original file line number Diff line number Diff line change 1919// RUN: | %FileCheck --check-prefixes=NEEDED,UNSAFE %s
2020
2121// 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 \
2235// RUN: -verify -Xllvm -debug-only=Serialization 2>&1 \
2336// RUN: | %FileCheck --check-prefixes=NEEDED,CLEAN,SAFE %s
2437
Original file line number Diff line number Diff line change 44
55// RUN: %target-swift-frontend -emit-module %s \
66// RUN: -enable-library-evolution -swift-version 5 \
7+ // RUN: -enable-deserialization-safety \
78// RUN: -Xllvm -debug-only=Serialization 2>&1 | %swift-demangle --simplified \
89// RUN: | %FileCheck --check-prefixes=SAFETY-PRIVATE,SAFETY-INTERNAL %s
910
1011// RUN: %target-swift-frontend -emit-module %s \
1112// RUN: -enable-library-evolution -swift-version 5 \
13+ // RUN: -enable-deserialization-safety \
1214// RUN: -Xllvm -debug-only=Serialization \
1315// RUN: -enable-testing 2>&1 \
1416// RUN: | %FileCheck --check-prefixes=DISABLED %s
1517
1618/// Don't mark decls as unsafe when private import is enabled.
1719// RUN: %target-swift-frontend -emit-module %s \
1820// RUN: -enable-library-evolution -swift-version 5 \
21+ // RUN: -enable-deserialization-safety \
1922// RUN: -Xllvm -debug-only=Serialization \
2023// RUN: -enable-private-imports 2>&1 \
2124// RUN: | %FileCheck --check-prefixes=DISABLED %s
2225
2326/// Don't mark decls as unsafe without library evolution.
2427// RUN: %target-swift-frontend -emit-module %s \
25- // RUN: -swift-version 5 \
28+ // RUN: -enable-deserialization-safety - swift-version 5 \
2629// RUN: -Xllvm -debug-only=Serialization 2>&1 \
2730// RUN: | %FileCheck --check-prefixes=DISABLED %s
2831
Original file line number Diff line number Diff line change 44
55// RUN: %target-swift-frontend -emit-module %s \
66// RUN: -enable-library-evolution -swift-version 5 \
7+ // RUN: -enable-deserialization-safety \
78// RUN: -Xllvm -debug-only=Serialization 2>&1 \
89// RUN: | %FileCheck --check-prefixes=SAFETY-PRIVATE,SAFETY-INTERNAL %s
910
1011// RUN: %target-swift-frontend -emit-module %s \
1112// RUN: -enable-library-evolution -swift-version 5 \
13+ // RUN: -enable-deserialization-safety \
1214// RUN: -Xllvm -debug-only=Serialization \
1315// RUN: -enable-testing 2>&1 \
1416// RUN: | %FileCheck --check-prefixes=DISABLED %s
1517
1618/// Don't mark decls as unsafe when private import is enabled.
1719// RUN: %target-swift-frontend -emit-module %s \
1820// RUN: -enable-library-evolution -swift-version 5 \
21+ // RUN: -enable-deserialization-safety \
1922// RUN: -Xllvm -debug-only=Serialization \
2023// RUN: -enable-private-imports 2>&1 \
2124// RUN: | %FileCheck --check-prefixes=DISABLED %s
2225
2326/// Don't mark decls as unsafe without library evolution.
2427// RUN: %target-swift-frontend -emit-module %s \
25- // RUN: -swift-version 5 \
28+ // RUN: -enable-deserialization-safety - swift-version 5 \
2629// RUN: -Xllvm -debug-only=Serialization 2>&1 \
2730// RUN: | %FileCheck --check-prefixes=DISABLED %s
2831
You can’t perform that action at this time.
0 commit comments