File tree Expand file tree Collapse file tree 2 files changed +22
-1
lines changed Expand file tree Collapse file tree 2 files changed +22
-1
lines changed Original file line number Diff line number Diff line change @@ -6192,7 +6192,7 @@ void SILGenFunction::emitApplyOfUnavailableCodeReached() {
61926192 }
61936193
61946194 auto declRef = SILDeclRef (fd);
6195- if (fd-> isBackDeployed ( getASTContext ())) {
6195+ if (SGM. requiresBackDeploymentThunk (fd, F. getResilienceExpansion ())) {
61966196 // The standard library entry point for the diagnostic function was
61976197 // introduced in Swift 5.9 so we call the back deployment thunk in case this
61986198 // code will execute on an older runtime.
Original file line number Diff line number Diff line change 1+ // RUN: %target-swift-emit-silgen -target %target-swift-abi-5.8-triple -module-name Test -parse-as-library %s -verify -unavailable-decl-optimization=stub | %FileCheck %s --check-prefixes=CHECK-SWIFT5_8
2+ // RUN: %target-swift-emit-silgen -target %target-swift-abi-5.9-triple -module-name Test -parse-as-library %s -verify -unavailable-decl-optimization=stub | %FileCheck %s --check-prefixes=CHECK-SWIFT5_9
3+
4+ // REQUIRES: OS=macosx
5+
6+ // CHECK-LABEL: sil{{.*}}@$s4Test15unavailableFuncyyF
7+ // CHECK-SWIFT5_8: [[FNREF:%.*]] = function_ref @$ss36_diagnoseUnavailableCodeReached_aeics5NeverOyF : $@convention(thin) () -> Never
8+ // CHECK-SWIFT5_9: [[FNREF:%.*]] = function_ref @$ss31_diagnoseUnavailableCodeReacheds5NeverOyF : $@convention(thin) () -> Never
9+ // CHECK-NEXT: [[APPLY:%.*]] = apply [[FNREF]]()
10+ // CHECK: } // end sil function '$s4Test15unavailableFuncyyF'
11+ @available ( * , unavailable)
12+ public func unavailableFunc( ) { }
13+
14+ // CHECK-LABEL: sil{{.*}}@$s4Test24unavailableInlinableFuncyyF
15+ // CHECK-SWIFT5_8: [[FNREF:%.*]] = function_ref @$ss36_diagnoseUnavailableCodeReached_aeics5NeverOyF : $@convention(thin) () -> Never
16+ // CHECK-SWIFT5_9: [[FNREF:%.*]] = function_ref @$ss31_diagnoseUnavailableCodeReacheds5NeverOyFTwb : $@convention(thin) () -> Never
17+ // CHECK-NEXT: [[APPLY:%.*]] = apply [[FNREF]]()
18+ // CHECK: } // end sil function '$s4Test24unavailableInlinableFuncyyF'
19+ @available ( * , unavailable)
20+ @inlinable public func unavailableInlinableFunc( ) { }
21+
You can’t perform that action at this time.
0 commit comments