Skip to content

Commit 75a48d8

Browse files
authored
Merge pull request #38465 from nkcsgexi/80703470-5.5
[5.5]ModuleInterface: pass down -disable-availability-checking to module building command
2 parents 283df2d + 2d5e4b5 commit 75a48d8

File tree

2 files changed

+20
-0
lines changed

2 files changed

+20
-0
lines changed

lib/Frontend/ModuleInterfaceLoader.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1182,6 +1182,10 @@ void InterfaceSubContextDelegateImpl::inheritOptionsForBuildingInterface(
11821182
// If we are supposed to use RequireOSSAModules, do so.
11831183
genericSubInvocation.getSILOptions().EnableOSSAModules =
11841184
bool(RequireOSSAModules);
1185+
if (LangOpts.DisableAvailabilityChecking) {
1186+
genericSubInvocation.getLangOptions().DisableAvailabilityChecking = true;
1187+
GenericArgs.push_back("-disable-availability-checking");
1188+
}
11851189
}
11861190

11871191
bool InterfaceSubContextDelegateImpl::extractSwiftInterfaceVersionAndArgs(
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
// REQUIRES: OS=macosx && CPU=x86_64
2+
// RUN: %empty-directory(%t)
3+
// RUN: %empty-directory(%t/inputs)
4+
// RUN: %empty-directory(%t/modulecache)
5+
// RUN: echo "// swift-interface-format-version: 1.0" > %t/inputs/Foo.swiftinterface
6+
// RUN: echo "// swift-module-flags: -module-name Foo" >> %t/inputs/Foo.swiftinterface
7+
// RUN: echo "@available(macOS 11, *)" >> %t/inputs/Foo.swiftinterface
8+
// RUN: echo "public class Foo {}" >> %t/inputs/Foo.swiftinterface
9+
// RUN: echo "public extension Foo { public func f() {} }" >> %t/inputs/Foo.swiftinterface
10+
11+
// RUN: not %target-swift-frontend -emit-module-path %t/Bar.swiftmodule -enable-library-evolution -enable-objc-interop -disable-objc-attr-requires-foundation-module -module-name Bar %s -I %t/inputs -target x86_64-apple-macos10.9 -module-cache-path %t/modulecache
12+
13+
// RUN: %target-swift-frontend -emit-module-path %t/Bar.swiftmodule -enable-library-evolution -enable-objc-interop -disable-objc-attr-requires-foundation-module -module-name Bar %s -I %t/inputs -target x86_64-apple-macos10.9 -disable-availability-checking -module-cache-path %t/modulecache
14+
15+
import Foo
16+

0 commit comments

Comments
 (0)