Skip to content

Commit 3a80ed7

Browse files
authored
Merge pull request #71663 from apple/es-bypass-opt
Move in-package resilience bypassing logic to a resilience check with accessing module
2 parents 2ded8ba + f96ef4a commit 3a80ed7

File tree

11 files changed

+103
-60
lines changed

11 files changed

+103
-60
lines changed

include/swift/AST/Decl.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2930,6 +2930,11 @@ class ValueDecl : public Decl {
29302930
/// if the base declaration is \c open, the override might have to be too.
29312931
bool hasOpenAccess(const DeclContext *useDC) const;
29322932

2933+
/// True if opted in for bypassing resilience within a package. Allowed only on
2934+
/// access from the \p accessingModule to a package decl in the defining
2935+
/// binary (not interface) module within the same package.
2936+
bool bypassResilienceInPackage(ModuleDecl *accessingModule) const;
2937+
29332938
/// FIXME: This is deprecated.
29342939
bool isRecursiveValidation() const;
29352940

include/swift/AST/DeclContext.h

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -530,13 +530,6 @@ class alignas(1 << DeclContextAlignInBits) DeclContext
530530
LLVM_READONLY
531531
PackageUnit *getPackageContext(bool lookupIfNotCurrent = false) const;
532532

533-
/// True if resilience checks can be bypassed within a package.
534-
/// \p isForPackageDecl Bypassing only applies to package types
535-
/// (possibly also public types later) if opted-in, client and defining module
536-
/// are in the same package, and the defining module is a binary module.
537-
LLVM_READONLY
538-
bool bypassResilienceInPackage(bool isForPackageDecl) const;
539-
540533
/// Returns the module context that contains this context.
541534
LLVM_READONLY
542535
ModuleDecl *getParentModule() const;

include/swift/AST/Module.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -482,7 +482,9 @@ class ModuleDecl
482482
}
483483

484484
bool inSamePackage(ModuleDecl *other) {
485-
return !getPackageName().empty() && getPackageName() == other->getPackageName();
485+
return other != nullptr &&
486+
!getPackageName().empty() &&
487+
getPackageName() == other->getPackageName();
486488
}
487489

488490
/// Get the package associated with this module

include/swift/Option/Options.td

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -516,7 +516,7 @@ def unavailable_decl_optimization_EQ : Joined<["-"], "unavailable-decl-optimizat
516516
"value may be 'none' (no optimization) or 'complete' (code is not "
517517
"generated at all unavailable declarations)">;
518518

519-
def package_bypass_resilience_optimization : Flag<["-"], "package-bypass-resilience-optimization">,
519+
def experimental_package_bypass_resilience : Flag<["-"], "experimental-package-bypass-resilience">,
520520
Flags<[FrontendOption]>,
521521
HelpText<"Enable optimization to bypass resilience within a package">;
522522

lib/AST/Decl.cpp

Lines changed: 22 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -2968,13 +2968,7 @@ bool AbstractStorageDecl::isResilient() const {
29682968
if (!accessScope.isPublicOrPackage())
29692969
return false;
29702970

2971-
if (!getModuleContext()->isResilient())
2972-
return false;
2973-
2974-
// Allows bypassing resilience checks for package decls
2975-
// at use site within a package if opted in, whether the
2976-
// loaded module was built resiliently or not.
2977-
return !getDeclContext()->bypassResilienceInPackage(accessScope.isPackage());
2971+
return getModuleContext()->isResilient();
29782972
}
29792973

29802974
bool AbstractStorageDecl::isResilient(ModuleDecl *M,
@@ -2983,7 +2977,12 @@ bool AbstractStorageDecl::isResilient(ModuleDecl *M,
29832977
case ResilienceExpansion::Minimal:
29842978
return isResilient();
29852979
case ResilienceExpansion::Maximal:
2986-
return M != getModuleContext() && isResilient();
2980+
if (M == getModuleContext())
2981+
return false;
2982+
// Non-resilient if bypass optimization in package is enabled
2983+
if (bypassResilienceInPackage(M))
2984+
return false;
2985+
return isResilient();
29872986
}
29882987
llvm_unreachable("bad resilience expansion");
29892988
}
@@ -4205,6 +4204,14 @@ bool ValueDecl::hasOpenAccess(const DeclContext *useDC) const {
42054204
return access == AccessLevel::Open;
42064205
}
42074206

4207+
bool ValueDecl::bypassResilienceInPackage(ModuleDecl *accessingModule) const {
4208+
return getASTContext().LangOpts.EnableBypassResilienceInPackage &&
4209+
getModuleContext()->inSamePackage(accessingModule) &&
4210+
!getModuleContext()->isBuiltFromInterface() &&
4211+
getFormalAccessScope(/*useDC=*/nullptr,
4212+
/*treatUsableFromInlineAsPublic=*/true).isPackage();
4213+
}
4214+
42084215
/// Given the formal access level for using \p VD, compute the scope where
42094216
/// \p VD may be accessed, taking \@usableFromInline, \@testable imports,
42104217
/// \@_spi imports, and enclosing access levels into account.
@@ -5045,14 +5052,7 @@ bool NominalTypeDecl::isFormallyResilient() const {
50455052
bool NominalTypeDecl::isResilient() const {
50465053
if (!isFormallyResilient())
50475054
return false;
5048-
if (!getModuleContext()->isResilient())
5049-
return false;
5050-
// Allows bypassing resilience checks for package decls
5051-
// at use site within a package if opted in, whether the
5052-
// loaded module was built resiliently or not.
5053-
auto accessScope = getFormalAccessScope(/*useDC=*/nullptr,
5054-
/*treatUsableFromInlineAsPublic=*/true);
5055-
return !getDeclContext()->bypassResilienceInPackage(accessScope.isPackage());
5055+
return getModuleContext()->isResilient();
50565056
}
50575057

50585058
DestructorDecl *NominalTypeDecl::getValueTypeDestructor() {
@@ -5083,9 +5083,12 @@ bool NominalTypeDecl::isResilient(ModuleDecl *M,
50835083
case ResilienceExpansion::Maximal:
50845084
// We can access declarations from the same module
50855085
// non-resiliently in a maximal context.
5086-
if (M == getModuleContext()) {
5086+
if (M == getModuleContext())
50875087
return false;
5088-
}
5088+
// Non-resilient if bypass optimization in package is enabled
5089+
if (bypassResilienceInPackage(M))
5090+
return false;
5091+
50895092
// If a protocol is originally declared in the current module, then we
50905093
// directly expose protocol witness tables and their contents for any
50915094
// conformances in the same module as symbols. If the protocol later
@@ -6376,7 +6379,7 @@ bool EnumDecl::isFormallyExhaustive(const DeclContext *useDC) const {
63766379
// package enum is optimized with bypassing resilience checks.
63776380
if (!accessScope.isPublicOrPackage())
63786381
return true;
6379-
if (useDC && useDC->bypassResilienceInPackage(accessScope.isPackage()))
6382+
if (useDC && bypassResilienceInPackage(useDC->getParentModule()))
63806383
return true;
63816384

63826385
// All other checks are use-site specific; with no further information, the

lib/AST/DeclContext.cpp

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -300,17 +300,6 @@ PackageUnit *DeclContext::getPackageContext(bool lookupIfNotCurrent) const {
300300
return nullptr;
301301
}
302302

303-
bool DeclContext::bypassResilienceInPackage(bool isForPackageDecl) const {
304-
// Bypassing resilience checks only applies to package types (and possibly
305-
// public types in the same package in the future). Allowed only if opted-in
306-
// for bypassing optimization, client and defining module are in the same
307-
// package, and defining module is a binary module.
308-
return isForPackageDecl &&
309-
getASTContext().LangOpts.EnableBypassResilienceInPackage &&
310-
getParentModule()->inSamePackage(getASTContext().MainModule) &&
311-
!getParentModule()->isBuiltFromInterface();
312-
}
313-
314303
ModuleDecl *DeclContext::getParentModule() const {
315304
// If the current context is PackageUnit, return the module
316305
// decl context pointing to the current context. This check

lib/Driver/ToolChains.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -299,7 +299,7 @@ void ToolChain::addCommonFrontendArgs(const OutputInfo &OI,
299299
inputArgs.AddLastArg(arguments, options::OPT_Rpass_missed_EQ);
300300
inputArgs.AddLastArg(arguments, options::OPT_suppress_warnings);
301301
inputArgs.AddLastArg(arguments, options::OPT_suppress_remarks);
302-
inputArgs.AddLastArg(arguments, options::OPT_package_bypass_resilience_optimization);
302+
inputArgs.AddLastArg(arguments, options::OPT_experimental_package_bypass_resilience);
303303
inputArgs.AddLastArg(arguments, options::OPT_profile_generate);
304304
inputArgs.AddLastArg(arguments, options::OPT_profile_use);
305305
inputArgs.AddLastArg(arguments, options::OPT_profile_coverage_mapping);

lib/Frontend/CompilerInvocation.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -671,7 +671,7 @@ static bool ParseLangArgs(LangOptions &Opts, ArgList &Args,
671671
Opts.EnablePackageInterfaceLoad = Args.hasArg(OPT_experimental_package_interface_load) ||
672672
::getenv("SWIFT_ENABLE_PACKAGE_INTERFACE_LOAD");
673673

674-
Opts.EnableBypassResilienceInPackage = Args.hasArg(OPT_package_bypass_resilience_optimization);
674+
Opts.EnableBypassResilienceInPackage = Args.hasArg(OPT_experimental_package_bypass_resilience);
675675

676676
Opts.DisableAvailabilityChecking |=
677677
Args.hasArg(OPT_disable_availability_checking);

test/IRGen/package_resilience.swift

Lines changed: 24 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -2,32 +2,37 @@
22
// Unlike its counterparts in the other *_resilience.swift files, the goal is
33
// for the package's component modules to all be considered within the same
44
// resilience domain. This file ensures that we use direct access to package
5-
// decls at use site as much as possible with -package-bypass-resilience-optimization.
5+
// decls at use site as much as possible with -experimental-package-bypass-resilience.
66
//
77

88
// RUN: %empty-directory(%t)
99
// RUN: %{python} %utils/chex.py < %s > %t/package_resilience.swift
1010
// RUN: %target-swift-frontend -package-name MyPkg -emit-module -enable-library-evolution -emit-module-path=%t/resilient_struct.swiftmodule -module-name=resilient_struct %S/Inputs/package_types/resilient_struct.swift
1111
// RUN: %target-swift-frontend -package-name MyPkg -emit-module -enable-library-evolution -emit-module-path=%t/resilient_enum.swiftmodule -module-name=resilient_enum -I %t %S/Inputs/package_types/resilient_enum.swift
1212
// RUN: %target-swift-frontend -package-name MyPkg -emit-module -enable-library-evolution -emit-module-path=%t/resilient_class.swiftmodule -module-name=resilient_class -I %t %S/Inputs/package_types/resilient_class.swift
13-
// RUN: %target-swift-frontend -package-name MyPkg -package-bypass-resilience-optimization -enable-objc-interop -I %t -emit-ir -enable-library-evolution %t/package_resilience.swift | %FileCheck %t/package_resilience.swift --check-prefixes=CHECK,CHECK-objc,CHECK-objc%target-ptrsize,CHECK-%target-ptrsize,CHECK-%target-cpu,CHECK-%target-import-type-objc-STABLE-ABI-%target-mandates-stable-abi,CHECK-%target-sdk-name -DINT=i%target-ptrsize -D#MDWORDS=7 -D#MDSIZE32=52 -D#MDSIZE64=80 -D#WORDSIZE=%target-alignment
14-
// RUN: %target-swift-frontend -package-name MyPkg -package-bypass-resilience-optimization -disable-objc-interop -I %t -emit-ir -enable-library-evolution %t/package_resilience.swift | %FileCheck %t/package_resilience.swift --check-prefixes=CHECK,CHECK-native,CHECK-native%target-ptrsize,CHECK-%target-ptrsize,CHECK-%target-cpu,CHECK-native-STABLE-ABI-%target-mandates-stable-abi,CHECK-%target-sdk-name -DINT=i%target-ptrsize -D#MDWORDS=4 -D#MDSIZE32=40 -D#MDSIZE64=56 -D#WORDSIZE=%target-alignment
15-
// RUN: %target-swift-frontend -package-name MyPkg -package-bypass-resilience-optimization -I %t -emit-ir -enable-library-evolution -O %t/package_resilience.swift -package-name MyPkg
13+
14+
// RUN: %target-swift-frontend -package-name MyPkg -module-name=package_resilience -experimental-package-bypass-resilience -enable-objc-interop -I %t -emit-ir -enable-library-evolution %t/package_resilience.swift | %FileCheck %t/package_resilience.swift --check-prefixes=CHECK,CHECK-objc,CHECK-objc%target-ptrsize,CHECK-%target-ptrsize,CHECK-%target-cpu,CHECK-%target-import-type-objc-STABLE-ABI-%target-mandates-stable-abi,CHECK-%target-sdk-name -DINT=i%target-ptrsize -D#MDWORDS=7 -D#MDSIZE32=52 -D#MDSIZE64=80 -D#WORDSIZE=%target-alignment
15+
16+
// RUN: %target-swift-frontend -package-name MyPkg -module-name=package_resilience -experimental-package-bypass-resilience -disable-objc-interop -I %t -emit-ir -enable-library-evolution %t/package_resilience.swift | %FileCheck %t/package_resilience.swift --check-prefixes=CHECK,CHECK-native,CHECK-native%target-ptrsize,CHECK-%target-ptrsize,CHECK-%target-cpu,CHECK-native-STABLE-ABI-%target-mandates-stable-abi,CHECK-%target-sdk-name -DINT=i%target-ptrsize -D#MDWORDS=4 -D#MDSIZE32=40 -D#MDSIZE64=56 -D#WORDSIZE=%target-alignment
17+
18+
// RUN: %target-swift-frontend -package-name MyPkg -module-name=package_resilience -experimental-package-bypass-resilience -I %t -emit-ir -enable-library-evolution -O %t/package_resilience.swift -package-name MyPkg
19+
1620
// REQUIRES: objc_codegen
1721
// REQUIRES: OS=macosx || OS=ios || OS=tvos || OS=watchos
1822
// REQUIRES: CPU=x86_64 || CPU=arm64
1923

20-
// CHECK: @"$s18package_resilience26ClassWithResilientPropertyC1p16resilient_struct5PointVvpWvd" = constant [[INT]] {{8|16}}, align [[#WORDSIZE]]
21-
// CHECK: @"$s18package_resilience26ClassWithResilientPropertyC1s16resilient_struct4SizeVvpWvd" = constant [[INT]] {{32|16}}, align [[#WORDSIZE]]
24+
// CHECK: @"$s18package_resilience26ClassWithResilientPropertyC1p16resilient_struct5PointVvpWvd" = hidden constant [[INT]] {{8|16}}, align [[#WORDSIZE]]
25+
// CHECK: @"$s18package_resilience26ClassWithResilientPropertyC1s16resilient_struct4SizeVvpWvd" = hidden constant [[INT]] {{32|16}}, align [[#WORDSIZE]]
2226

23-
// CHECK: @"$s18package_resilience33ClassWithResilientlySizedPropertyC1r16resilient_struct9RectangleVvpWvd" = constant [[INT]] {{8|16}}, align [[#WORDSIZE]]
24-
// CHECK: @"$s18package_resilience33ClassWithResilientlySizedPropertyC5colors5Int32VvpWvd" = constant [[INT]] 56, align [[#WORDSIZE]]
27+
// CHECK: @"$s18package_resilience33ClassWithResilientlySizedPropertyC1r16resilient_struct9RectangleVvpWvd" = hidden constant [[INT]] {{8|16}}, align [[#WORDSIZE]]
28+
// CHECK: @"$s18package_resilience33ClassWithResilientlySizedPropertyC5colors5Int32VvpWvd" = hidden constant [[INT]] 56, align [[#WORDSIZE]]
2529

30+
// class metadata base offset for package_resilience.MyResilientParent
2631
// CHECK: @"$s18package_resilience17MyResilientParentCMo" = constant [[BOUNDS:{ (i32|i64), i32, i32 }]]
2732
// CHECK-32-SAME: { [[INT]] [[#MDSIZE32]], i32 3, i32 [[#MDWORDS + 6 + 2]] }, align [[#WORDSIZE]]
2833
// CHECK-64-SAME: { [[INT]] [[#MDSIZE64]], i32 3, i32 [[#MDWORDS + 3 + 2]] }, align [[#WORDSIZE]]
2934

30-
// CHECK: @"$s18package_resilience16MyResilientChildC5fields5Int32VvpWvd" = constant [[INT]] [[#WORDSIZE + WORDSIZE + 4]], align [[#WORDSIZE]]
35+
// CHECK: @"$s18package_resilience16MyResilientChildC5fields5Int32VvpWvd" = hidden constant [[INT]] [[#WORDSIZE + WORDSIZE + 4]], align [[#WORDSIZE]]
3136

3237
// CHECK: @"$s18package_resilience16MyResilientChildCMo" = {{(protected )?}}{{(dllexport )?}}constant [[BOUNDS]]
3338
// CHECK-32-SAME: { [[INT]] [[#MDSIZE32 + WORDSIZE + WORDSIZE]], i32 3, i32 [[#MDWORDS + 6 + 3]] }
@@ -41,17 +46,16 @@
4146
// CHECK-32-SAME: { [[INT]] [[#MDSIZE32 + WORDSIZE + WORDSIZE + WORDSIZE]], i32 3, i32 [[#MDWORDS + 6 + 5]] }
4247
// CHECK-64-SAME: { [[INT]] [[#MDSIZE64 + WORDSIZE + WORDSIZE + WORDSIZE]], i32 3, i32 [[#MDWORDS + 3 + 5]] }
4348

44-
// CHECK: @"$s18package_resilience27ClassWithEmptyThenResilientC5emptyAA0E0VvpWvd" = constant [[INT]] 0,
45-
// CHECK: @"$s18package_resilience27ClassWithEmptyThenResilientC9resilient0H7_struct0G3IntVvpWvd" = constant [[INT]] [[#WORDSIZE + WORDSIZE]], align [[#WORDSIZE]]
46-
// CHECK: @"$s18package_resilience27ClassWithResilientThenEmptyC9resilient0H7_struct0E3IntVvpWvd" = constant [[INT]] [[#WORDSIZE + WORDSIZE]], align [[#WORDSIZE]]
47-
// CHECK: @"$s18package_resilience27ClassWithResilientThenEmptyC5emptyAA0G0VvpWvd" = constant [[INT]] 0,
49+
// CHECK: @"$s18package_resilience27ClassWithEmptyThenResilientC5emptyAA0E0VvpWvd" = hidden constant [[INT]] 0,
50+
// CHECK: @"$s18package_resilience27ClassWithEmptyThenResilientC9resilient0H7_struct0G3IntVvpWvd" = hidden constant [[INT]] [[#WORDSIZE + WORDSIZE]], align [[#WORDSIZE]]
51+
// CHECK: @"$s18package_resilience27ClassWithResilientThenEmptyC9resilient0H7_struct0E3IntVvpWvd" = hidden constant [[INT]] [[#WORDSIZE + WORDSIZE]], align [[#WORDSIZE]]
52+
// CHECK: @"$s18package_resilience27ClassWithResilientThenEmptyC5emptyAA0G0VvpWvd" = hidden constant [[INT]] 0,
4853

4954
import resilient_class
5055
import resilient_struct
5156
import resilient_enum
5257

5358
// Concrete class with resilient stored property
54-
5559
package class ClassWithResilientProperty {
5660
package let p: Point
5761
package let s: Size
@@ -230,15 +234,17 @@ public func memoryLayoutDotAlignmentWithResilientStruct() -> Int {
230234
return MemoryLayout<Size>.alignment
231235
}
232236

233-
// CHECK: define{{( dllexport)?}}{{( protected)?}} swiftcc [[BOUNDS:{ (i32|i64), (i32|i64), i8 }]] @"$s18package_resilience31constructResilientEnumNoPayload14resilient_enum6MediumOyF"
237+
// CHECK: define{{( dllexport)?}}{{( protected)?}} swiftcc void @"$s18package_resilience31constructResilientEnumNoPayload14resilient_enum6MediumOyF"
234238
package func constructResilientEnumNoPayload() -> Medium {
235-
// CHECK: ret [[BOUNDS]] { {{i32|i64}} 0, {{i32|i64}} 0, i8 2 }
239+
// CHECK: [[FIELD_PTR:%.*]] = getelementptr inbounds %T14resilient_enum6MediumO, ptr %0, i32 0, i32 1
240+
// CHECK: ret void
236241
return Medium.Paper
237242
}
238243

239-
// CHECK: define{{( dllexport)?}}{{( protected)?}} swiftcc [[BOUNDS:{ (i32|i64), (i32|i64), i8 }]] @"$s18package_resilience39constructExhaustiveWithResilientMembers14resilient_enum11SimpleShapeOyF"() #0 {
244+
// CHECK: define{{( dllexport)?}}{{( protected)?}} swiftcc void @"$s18package_resilience39constructExhaustiveWithResilientMembers14resilient_enum11SimpleShapeOyF"
240245
package func constructExhaustiveWithResilientMembers() -> SimpleShape {
241-
// CHECK: ret [[BOUNDS]] { {{i32|i64}} 0, {{i32|i64}} 0, i8 1 }
246+
// CHECK: [[FIELD_PTR:%.*]] = getelementptr inbounds %T14resilient_enum11SimpleShapeO, ptr %0, i32 0, i32 1
247+
// CHECK: ret void
242248
return .KleinBottle
243249
}
244250

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
// RUN: %empty-directory(%t)
2+
// RUN: split-file %s %t
3+
4+
// RUN: %target-swift-frontend -emit-module %t/Utils.swift \
5+
// RUN: -module-name Utils -swift-version 5 -I %t \
6+
// RUN: -package-name mypkg \
7+
// RUN: -enable-library-evolution \
8+
// RUN: -emit-module -emit-module-path %t/Utils.swiftmodule
9+
10+
// RUN: %target-swift-frontend -emit-silgen %t/Client.swift -I %t -module-name Client -package-name mypkg | %FileCheck %s --check-prefixes=CHECK,CHECK-DEFAULT
11+
// RUN: %target-swift-frontend -emit-silgen %t/Client.swift -I %t -module-name Client -package-name mypkg -enable-library-evolution | %FileCheck %s --check-prefixes=CHECK,CHECK-DEFAULT
12+
13+
// RUN: %target-swift-frontend -emit-silgen %t/Client.swift -I %t -module-name Client -package-name mypkg -experimental-package-bypass-resilience | %FileCheck %s --check-prefixes=CHECK,CHECK-BYPASS
14+
// RUN: %target-swift-frontend -emit-silgen %t/Client.swift -I %t -module-name Client -package-name mypkg -experimental-package-bypass-resilience -enable-library-evolution | %FileCheck %s --check-prefixes=CHECK,CHECK-BYPASS
15+
16+
//--- Utils.swift
17+
package struct PkgStruct {
18+
package var pkgVar = 1
19+
package init() {}
20+
}
21+
22+
public struct PubStruct {
23+
public var pubVar = 1
24+
public init() {}
25+
}
26+
27+
//--- Client.swift
28+
import Utils
29+
30+
func foo() {
31+
print(PkgStruct().pkgVar)
32+
}
33+
34+
// CHECK: sil hidden [ossa] @$s6Client3fooyyF : $@convention(thin) () -> () {
35+
// CHECK-DEFAULT: [[F_REF:%.*]] = function_ref @$s5Utils9PkgStructV6pkgVarSivg : $@convention(method) (@in_guaranteed PkgStruct) -> Int
36+
// CHECK-DEFAULT: sil package_external @$s5Utils9PkgStructV6pkgVarSivg : $@convention(method) (@in_guaranteed PkgStruct) -> Int
37+
// CHECK-BYPASS: [[ADDR:%.*]] = struct_element_addr %7 : $*PkgStruct, #PkgStruct.pkgVar
38+
39+
func bar() {
40+
print(PubStruct().pubVar)
41+
}
42+
43+
// CHECK: sil hidden [ossa] @$s6Client3baryyF : $@convention(thin) () -> () {
44+
// CHECK: [[F_REF:%.*]] = function_ref @$s5Utils9PubStructV6pubVarSivg : $@convention(method) (@in_guaranteed PubStruct) -> Int
45+
// CHECK: sil @$s5Utils9PubStructV6pubVarSivg : $@convention(method) (@in_guaranteed PubStruct) -> Int

test/Sema/package_resilience_bypass_exhaustive_switch.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
// RUN: %target-swift-frontend -typecheck %t/ClientDefault.swift -I %t -swift-version 5 -package-name mypkg -verify
1111

12-
// RUN: %target-swift-frontend -typecheck %t/ClientOptimized.swift -I %t -swift-version 5 -package-name mypkg -package-bypass-resilience-optimization -verify
12+
// RUN: %target-swift-frontend -typecheck %t/ClientOptimized.swift -I %t -swift-version 5 -package-name mypkg -experimental-package-bypass-resilience -verify
1313

1414
//--- Utils.swift
1515

0 commit comments

Comments
 (0)