Skip to content

Commit 00786d9

Browse files
authored
Merge pull request #38455 from nkcsgexi/80703470
2 parents 971537c + d237455 commit 00786d9

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
@@ -1319,6 +1319,10 @@ void InterfaceSubContextDelegateImpl::inheritOptionsForBuildingInterface(
13191319
// If we are supposed to use RequireOSSAModules, do so.
13201320
genericSubInvocation.getSILOptions().EnableOSSAModules =
13211321
bool(RequireOSSAModules);
1322+
if (LangOpts.DisableAvailabilityChecking) {
1323+
genericSubInvocation.getLangOptions().DisableAvailabilityChecking = true;
1324+
GenericArgs.push_back("-disable-availability-checking");
1325+
}
13221326
}
13231327

13241328
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
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)