Skip to content

[CMake] Unbreak minimal Swift builds #36841

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 17, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion include/swift/Basic/LangOptions.h
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,8 @@ namespace swift {
bool EnableInferPublicSendable = false;

/// Disable the implicit import of the _Concurrency module.
bool DisableImplicitConcurrencyModuleImport = false;
bool DisableImplicitConcurrencyModuleImport =
!SWIFT_ENABLE_EXPERIMENTAL_CONCURRENCY;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would it be easier to check SWIFT_ENABLE_EXPERIMENTAL_CONCURRENCY in shouldImportConcurrencyByDefault where we make the decision?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think it would be easier, and adjusting it in LangOpts makes the default match the build setup. Otherwise, I don't have a strong opinion about this. If people want to debate this in a subsequent pull request, that seems fine. I just want to unbreak minimum dependency builds.


/// Should we check the target OSs of serialized modules to see that they're
/// new enough?
Expand Down
2 changes: 2 additions & 0 deletions include/swift/Config.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,6 @@

#cmakedefine HAVE_PROC_PID_RUSAGE 1

#cmakedefine01 SWIFT_ENABLE_EXPERIMENTAL_CONCURRENCY

#endif // SWIFT_CONFIG_H
4 changes: 4 additions & 0 deletions stdlib/cmake/modules/SwiftSource.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -260,6 +260,10 @@ function(_add_target_variant_swift_compile_flags
list(APPEND result "-D" "INTERNAL_CHECKS_ENABLED")
endif()

if(SWIFT_ENABLE_EXPERIMENTAL_CONCURRENCY)
list(APPEND result "-D" "SWIFT_ENABLE_EXPERIMENTAL_CONCURRENCY")
endif()

if(SWIFT_ENABLE_RUNTIME_FUNCTION_COUNTERS)
list(APPEND result "-D" "SWIFT_ENABLE_RUNTIME_FUNCTION_COUNTERS")
endif()
Expand Down
7 changes: 6 additions & 1 deletion stdlib/private/StdlibUnittest/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@ if (NOT IS_BUILD_TYPE_OPTIMIZED)
list(APPEND swift_stdlib_unittest_compile_flags "-DSWIFT_STDLIB_DEBUG")
endif()

set(swift_stdlib_unittest_link_libraries "")
if (SWIFT_ENABLE_EXPERIMENTAL_CONCURRENCY)
list(APPEND swift_stdlib_unittest_link_libraries "swift_Concurrency")
endif()

add_swift_target_library(swiftStdlibUnittest ${SWIFT_STDLIB_LIBRARY_BUILD_TYPES} IS_STDLIB
# This file should be listed the first. Module name is inferred from the
# filename.
Expand Down Expand Up @@ -46,6 +51,6 @@ add_swift_target_library(swiftStdlibUnittest ${SWIFT_STDLIB_LIBRARY_BUILD_TYPES}
SWIFT_COMPILE_FLAGS ${swift_stdlib_unittest_compile_flags} ${SWIFT_STANDARD_LIBRARY_SWIFT_FLAGS}
INSTALL_IN_COMPONENT stdlib-experimental
DARWIN_INSTALL_NAME_DIR "${SWIFT_DARWIN_STDLIB_PRIVATE_INSTALL_NAME_DIR}"
LINK_LIBRARIES swift_Concurrency)
LINK_LIBRARIES ${swift_stdlib_unittest_link_libraries})
set_source_files_properties(InspectValue.cpp PROPERTIES COMPILE_FLAGS -std=c++14)

24 changes: 24 additions & 0 deletions stdlib/private/StdlibUnittest/StdlibUnittest.swift
Original file line number Diff line number Diff line change
Expand Up @@ -875,6 +875,7 @@ func _childProcess() {
}
}

#if SWIFT_ENABLE_EXPERIMENTAL_CONCURRENCY
@inline(never)
func _childProcessAsync() async {
_installTrapInterceptor()
Expand Down Expand Up @@ -928,6 +929,7 @@ func _childProcessAsync() async {
}
}
}
#endif

class _ParentProcess {
#if os(Windows)
Expand Down Expand Up @@ -1367,6 +1369,7 @@ class _ParentProcess {
}
}

#if SWIFT_ENABLE_EXPERIMENTAL_CONCURRENCY
internal func runOneTestAsync(
fullTestName: String,
testSuite: TestSuite,
Expand Down Expand Up @@ -1457,6 +1460,7 @@ class _ParentProcess {
return .xFail
}
}
#endif


func run() {
Expand Down Expand Up @@ -1531,6 +1535,7 @@ class _ParentProcess {
}
}

#if SWIFT_ENABLE_EXPERIMENTAL_CONCURRENCY
func runAsync() async {
if let filter = _filter {
print("StdlibUnittest: using filter: \(filter)")
Expand Down Expand Up @@ -1602,6 +1607,7 @@ class _ParentProcess {
_testSuiteFailedCallback()
}
}
#endif

}

Expand Down Expand Up @@ -1713,6 +1719,7 @@ public func runAllTests() {
}
}

#if SWIFT_ENABLE_EXPERIMENTAL_CONCURRENCY
public func runAllTestsAsync() async {
if PersistentState.runNoTestsWasCalled {
print("runAllTests() called after runNoTests(). Aborting.")
Expand Down Expand Up @@ -1780,6 +1787,7 @@ public func runAllTestsAsync() async {
await parent.runAsync()
}
}
#endif

#if SWIFT_RUNTIME_ENABLE_LEAK_CHECKER

Expand Down Expand Up @@ -1816,6 +1824,7 @@ public final class TestSuite {
.code(testFunction)
}

#if SWIFT_ENABLE_EXPERIMENTAL_CONCURRENCY
// This method is prohibited from inlining because inlining the test harness
// into the test is not interesting from the runtime performance perspective.
// And it does not really make the test cases more effectively at testing the
Expand All @@ -1830,6 +1839,7 @@ public final class TestSuite {
_TestBuilder(testSuite: self, name: name, loc: SourceLoc(file, line))
.code(testFunction)
}
#endif

// This method is prohibited from inlining because inlining the test harness
// into the test is not interesting from the runtime performance perspective.
Expand Down Expand Up @@ -1876,10 +1886,12 @@ public final class TestSuite {
code()
case .parameterized(code: let code, _):
code(parameter!)
#if SWIFT_ENABLE_EXPERIMENTAL_CONCURRENCY
case .singleAsync(_):
fatalError("Cannot call async code, use `runAllTestsAsync`")
case .parameterizedAsync(code: _, _):
fatalError("Cannot call async code, use `runAllTestsAsync`")
#endif
}

#if SWIFT_RUNTIME_ENABLE_LEAK_CHECKER
Expand All @@ -1894,6 +1906,7 @@ public final class TestSuite {
file: test.testLoc.file, line: test.testLoc.line)
}

#if SWIFT_ENABLE_EXPERIMENTAL_CONCURRENCY
func _runTestAsync(name testName: String, parameter: Int?) async {
PersistentState.ranSomething = true
for r in _allResettables {
Expand All @@ -1917,13 +1930,15 @@ public final class TestSuite {
code()
case .parameterized(code: let code, _):
code(parameter!)
#if SWIFT_ENABLE_EXPERIMENTAL_CONCURRENCY
case .singleAsync(let code):
precondition(
parameter == nil,
"can't pass parameters to non-parameterized tests")
await code()
case .parameterizedAsync(code: let code, _):
await code(parameter!)
#endif
}

#if SWIFT_RUNTIME_ENABLE_LEAK_CHECKER
Expand All @@ -1937,6 +1952,7 @@ public final class TestSuite {
0, LifetimeTracked.instances, "Found leaked LifetimeTracked instances.",
file: test.testLoc.file, line: test.testLoc.line)
}
#endif

func _testByName(_ testName: String) -> _Test {
return _tests[_testNameToIndex[testName]!]
Expand All @@ -1956,8 +1972,10 @@ public final class TestSuite {
internal enum _TestCode {
case single(code: () -> Void)
case parameterized(code: (Int) -> Void, count: Int)
#if SWIFT_ENABLE_EXPERIMENTAL_CONCURRENCY
case singleAsync(code: () async -> Void)
case parameterizedAsync(code: (Int) async -> Void, count: Int)
#endif
}

internal struct _Test {
Expand Down Expand Up @@ -1991,10 +2009,12 @@ public final class TestSuite {
return [nil]
case .parameterized(code: _, count: let count):
return Array(0..<count)
#if SWIFT_ENABLE_EXPERIMENTAL_CONCURRENCY
case .singleAsync:
return [nil]
case .parameterizedAsync(code: _, count: let count):
return Array(0..<count)
#endif
}
}
}
Expand Down Expand Up @@ -2063,9 +2083,11 @@ public final class TestSuite {
_build(.single(code: testFunction))
}

#if SWIFT_ENABLE_EXPERIMENTAL_CONCURRENCY
public func code(_ testFunction: @escaping () async -> Void) {
_build(.singleAsync(code: testFunction))
}
#endif

public func forEach<Data>(
in parameterSets: [Data],
Expand All @@ -2076,6 +2098,7 @@ public final class TestSuite {
count: parameterSets.count))
}

#if SWIFT_ENABLE_EXPERIMENTAL_CONCURRENCY
public func forEach<Data>(
in parameterSets: [Data],
testFunction: @escaping (Data) async -> Void
Expand All @@ -2084,6 +2107,7 @@ public final class TestSuite {
code: { (i: Int) in await testFunction(parameterSets[i]) },
count: parameterSets.count))
}
#endif

}

Expand Down
1 change: 0 additions & 1 deletion test/IDE/Inputs/foo_swift_module.printed.comments.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import SwiftOnoneSupport
import _Concurrency

func %%% (lhs: Int, rhs: Int) -> Int

Expand Down
2 changes: 1 addition & 1 deletion test/IDE/print_module_comments.swift
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// RUN: %empty-directory(%t)
//
// Build swift modules this test depends on.
// RUN: %target-swift-frontend -emit-module %S/Inputs/foo_swift_module.swift -emit-module-path %t/foo_swift_module.swiftmodule -emit-module-doc-path %t/foo_swift_module.swiftdoc
// RUN: %target-swift-frontend -disable-implicit-concurrency-module-import -emit-module %S/Inputs/foo_swift_module.swift -emit-module-path %t/foo_swift_module.swiftmodule -emit-module-doc-path %t/foo_swift_module.swiftdoc
//
// RUN: %target-swift-ide-test -print-module -source-filename %s -I %t -module-to-print=foo_swift_module > %t.printed.txt
// RUN: diff %t.printed.txt %S/Inputs/foo_swift_module.printed.comments.txt
Expand Down
3 changes: 1 addition & 2 deletions test/Index/Store/cross-import-overlay.swift
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
// RUN: cp -r %S/../Inputs/CrossImport %t/CrossImport
// RUN: %{python} %S/../../CrossImport/Inputs/rewrite-module-triples.py %t/CrossImport %module-target-triple

// RUN: %target-swift-frontend -c -index-store-path %t/idx -module-cache-path %t/mcp -index-system-modules -index-ignore-stdlib -enable-cross-import-overlays %s -Fsystem %t/CrossImport -o %t/file1.o -module-name cross_import_overlay
// RUN: %target-swift-frontend -disable-implicit-concurrency-module-import -c -index-store-path %t/idx -module-cache-path %t/mcp -index-system-modules -index-ignore-stdlib -enable-cross-import-overlays %s -Fsystem %t/CrossImport -o %t/file1.o -module-name cross_import_overlay
// RUN: c-index-test core -print-unit %t/idx > %t/units

import A
Expand All @@ -30,7 +30,6 @@ from__ABAdditionsCAdditions()
// MAIN-NEXT: is-debug: 1
// MAIN-NEXT: DEPEND START
// MAIN-NEXT: Unit | system | Swift | {{.*}}{{/|\\}}Swift.swiftmodule
// MAIN-NEXT: Unit | system | _Concurrency | {{.*}}{{/|\\}}_Concurrency.swiftmodule
// MAIN-NEXT: Unit | system | B | {{.*}}{{/|\\}}B.swiftmodule{{/|\\}}{{.*}}
// MAIN-NEXT: Unit | system | C | {{.*}}{{/|\\}}C.swiftmodule{{/|\\}}{{.*}}
// MAIN-NEXT: Unit | system | A | {{.*}}{{/|\\}}__ABAdditionsCAdditions.swiftmodule{{/|\\}}{{.*}}
Expand Down
7 changes: 3 additions & 4 deletions test/Index/Store/unit-from-compile.swift
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// RUN: %empty-directory(%t)
// RUN: %target-swift-frontend -c -index-store-path %t/idx %s -o %t/file1.o -module-name some_module_test
// RUN: %target-swift-frontend -disable-implicit-concurrency-module-import -c -index-store-path %t/idx %s -o %t/file1.o -module-name some_module_test
// RUN: c-index-test core -print-unit %t/idx | %FileCheck %s
// RUN: %target-swift-frontend -c -index-store-path %t/idx_opt %s -o %t/file1.o -module-name some_module_test -O
// RUN: %target-swift-frontend -disable-implicit-concurrency-module-import -c -index-store-path %t/idx_opt %s -o %t/file1.o -module-name some_module_test -O
// RUN: c-index-test core -print-unit %t/idx | %FileCheck %s -check-prefix=OPT

// CHECK: file1.o
Expand All @@ -16,7 +16,6 @@

// CHECK: DEPEND START
// CHECK: Unit | system | {{.*}}{{/|\\}}Swift.swiftmodule
// CHECK: Unit | system | _Concurrency
// CHECK: DEPEND END (2)
// CHECK: DEPEND END (1)

// OPT: is-debug: 1
5 changes: 2 additions & 3 deletions test/Index/Store/unit-one-file-multi-file-invocation.swift
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// RUN: %empty-directory(%t)
// RUN: %target-build-swift -index-file -index-file-path %s %s %S/Inputs/SwiftModuleA.swift -module-name unit_one_test -o %t/00-output_for_index -index-store-path %t/idx
// RUN: %target-build-swift -Xfrontend -disable-implicit-concurrency-module-import -index-file -index-file-path %s %s %S/Inputs/SwiftModuleA.swift -module-name unit_one_test -o %t/00-output_for_index -index-store-path %t/idx
// RUN: c-index-test core -print-unit %t/idx | %FileCheck %s -implicit-check-not SwiftShims

// The output is sorted by last path component, so make sure the top-level entry
Expand All @@ -8,9 +8,8 @@
// CHECK: 00-output_for_index
// CHECK: DEPEND START
// CHECK: Unit | system | Swift | [[MODULE:.*[/\\]Swift[.]swiftmodule([/\\].+[.]swiftmodule)?]] | [[SWIFT:.+[.]swiftmodule-[A-Z0-9]*]]
// CHECK: Unit | system | _Concurrency | {{.*}}
// CHECK: Record | user | {{.*}}{{/|\\}}unit-one-file-multi-file-invocation.swift |
// CHECK: DEPEND END (3)
// CHECK: DEPEND END (2)

// CHECK: [[SWIFT]]
// CHECK: DEPEND START
Expand Down
9 changes: 4 additions & 5 deletions test/Index/Store/unit-pcm-dependency.swift
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
// RUN: rm -rf %t
// RUN: %target-swift-frontend -index-store-path %t/idx -primary-file %s -o %t/s1.o -I %S/Inputs -typecheck -module-cache-path %t/mcp -enable-objc-interop
// RUN: %target-swift-frontend -disable-implicit-concurrency-module-import -index-store-path %t/idx -primary-file %s -o %t/s1.o -I %S/Inputs -typecheck -module-cache-path %t/mcp -enable-objc-interop
// RUN: c-index-test core -print-unit %t/idx | %FileCheck %s -check-prefix=FILE1

// If the module cache already exists, the pcm gets indexed.
// RUN: rm -rf %t/idx
// RUN: %target-swift-frontend -index-store-path %t/idx -primary-file %s -o %t/s1.o -I %S/Inputs -typecheck -module-cache-path %t/mcp -enable-objc-interop
// RUN: %target-swift-frontend -disable-implicit-concurrency-module-import -index-store-path %t/idx -primary-file %s -o %t/s1.o -I %S/Inputs -typecheck -module-cache-path %t/mcp -enable-objc-interop
// RUN: c-index-test core -print-unit %t/idx | %FileCheck %s -check-prefix=FILE1

// FIXME: index the bridging header!

// RUN: %empty-directory(%t)
// RUN: echo 'import ClangModuleA' > %t/s2.swift
// RUN: %target-swift-frontend -index-store-path %t/idx %s %t/s2.swift -o %t/s1.o -o %t/s2.o -I %S/Inputs -c -emit-module -module-name main -emit-module-path %t/main.swiftmodule -module-cache-path %t/mcp -enable-objc-interop
// RUN: %target-swift-frontend -disable-implicit-concurrency-module-import -index-store-path %t/idx %s %t/s2.swift -o %t/s1.o -o %t/s2.o -I %S/Inputs -c -emit-module -module-name main -emit-module-path %t/main.swiftmodule -module-cache-path %t/mcp -enable-objc-interop
// RUN: c-index-test core -print-unit %t/idx > %t/both.txt
// RUN: %FileCheck %s -check-prefix=FILE1 < %t/both.txt
// RUN: %FileCheck %s -check-prefix=FILE2 < %t/both.txt
Expand Down Expand Up @@ -50,14 +50,13 @@ func test() {
// FILE1-NOT: ClangModuleA.h
// FILE1-NOT: Unit |{{.*}}ClangModuleA
// FILE1: Unit | system | Swift | {{.*}}Swift.swiftmodule
// FILE1: Unit | system | _Concurrency
// FILE1-NOT: Unit |{{.*}}ClangModuleA
// FILE1: Unit | user | ClangModuleB | {{.*}}ClangModuleB-{{[A-Z0-9]*}}.pcm | ClangModuleB-{{[A-Z0-9]*}}.pcm-
// FILE1: Unit | user | ClangModuleC | {{.*}}ClangModuleC-{{[A-Z0-9]*}}.pcm | ClangModuleC-{{[A-Z0-9]*}}.pcm-
// FILE1-NOT: Unit |{{.*}}ClangModuleA
// FILE1: Record | user | {{.*}}unit-pcm-dependency.swift | unit-pcm-dependency.swift-
// FILE1-NOT: Unit |{{.*}}ClangModuleA
// FILE1: DEPEND END (5)
// FILE1: DEPEND END (4)

// FILE2-NOT: main.swiftmodule-

Expand Down
11 changes: 5 additions & 6 deletions test/Index/Store/unit-with-bridging-header.swift
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
// RUN: %empty-directory(%t)
// RUN: %target-swift-frontend(mock-sdk: %clang-importer-sdk) -emit-pch -index-store-path %t/idx -o %t/bridge-head.pch %S/Inputs/bridge-head.h
// RUN: %target-swift-frontend(mock-sdk: %clang-importer-sdk) -typecheck -import-objc-header %t/bridge-head.pch -primary-file %s -o %t/s1.o -index-store-path %t/idx
// RUN: %target-swift-frontend(mock-sdk: %clang-importer-sdk) -disable-implicit-concurrency-module-import -emit-pch -index-store-path %t/idx -o %t/bridge-head.pch %S/Inputs/bridge-head.h
// RUN: %target-swift-frontend(mock-sdk: %clang-importer-sdk) -disable-implicit-concurrency-module-import -typecheck -import-objc-header %t/bridge-head.pch -primary-file %s -o %t/s1.o -index-store-path %t/idx
// RUN: c-index-test core -print-record %t/idx | %FileCheck %s --check-prefix=PCH-RECORD
// RUN: c-index-test core -print-unit %t/idx | %FileCheck %s --check-prefix=PCH-UNIT
// RUN: %target-swift-frontend(mock-sdk: %clang-importer-sdk) -typecheck -import-objc-header %S/Inputs/bridge-head.h -primary-file %s -o %t/s1.o -index-store-path %t/idx2
// RUN: %target-swift-frontend(mock-sdk: %clang-importer-sdk) -disable-implicit-concurrency-module-import -typecheck -import-objc-header %S/Inputs/bridge-head.h -primary-file %s -o %t/s1.o -index-store-path %t/idx2
// RUN: c-index-test core -print-unit %t/idx2 | %FileCheck --check-prefix=TEXTUAL-UNIT %s

// PCH-RECORD: bridge-include.h
Expand Down Expand Up @@ -32,16 +32,15 @@
// PCH-UNIT: DEPEND START
// PCH-UNIT: Unit | system | {{.*}}Swift.swiftmodule
// PCH-UNIT: Unit | user | {{.*}}bridge-head.pch | bridge-head.pch-
// PCH-UNIT: Unit | system | _Concurrency |
// PCH-UNIT: Record | user | {{.*}}unit-with-bridging-header.swift | unit-with-bridging-header.swift-
// PCH-UNIT: DEPEND END (4)
// PCH-UNIT: DEPEND END (3)

// TEXTUAL-UNIT: s1.o-
// TEXTUAL-UNIT: --------
// TEXTUAL-UNIT: has-main: 1
// TEXTUAL-UNIT: DEPEND START
// TEXTUAL-UNIT: Unit | system | {{.*}}Swift.swiftmodule
// TEXTUAL-UNIT: Record | user | {{.*}}unit-with-bridging-header.swift | unit-with-bridging-header.swift-
// TEXTUAL-UNIT: DEPEND END (3)
// TEXTUAL-UNIT: DEPEND END (2)

func test() {}
5 changes: 2 additions & 3 deletions test/ModuleInterface/imports-submodule-order.swift
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// RUN: %target-swift-frontend -typecheck -emit-module-interface-path - %s -I %S/Inputs/imports-submodule-order/ | %FileCheck %s
// RUN: %target-swift-frontend -typecheck -emit-module-interface-path - %s -I %S/Inputs/imports-submodule-order/ -D XY | %FileCheck %s
// RUN: %target-swift-frontend -disable-implicit-concurrency-module-import -typecheck -emit-module-interface-path - %s -I %S/Inputs/imports-submodule-order/ | %FileCheck %s
// RUN: %target-swift-frontend -disable-implicit-concurrency-module-import -typecheck -emit-module-interface-path - %s -I %S/Inputs/imports-submodule-order/ -D XY | %FileCheck %s

#if XY
@_exported import X.Submodule
Expand All @@ -20,5 +20,4 @@
// CHECK-NEXT: {{^}}import Swift{{$}}
// CHECK-NEXT: import X{{$}}
// CHECK-NEXT: import Y{{$}}
// CHECK-NEXT: {{^}}import _Concurrency{{$}}
// CHECK-NOT: import
7 changes: 3 additions & 4 deletions test/ModuleInterface/imports.swift
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// RUN: %empty-directory(%t)
// RUN: %target-swift-frontend -emit-module -o %t/empty.swiftmodule %S/../Inputs/empty.swift
// RUN: %target-swift-frontend -emit-module -o %t/emptyButWithLibraryEvolution.swiftmodule %S/../Inputs/empty.swift -enable-library-evolution
// RUN: %target-swift-frontend -typecheck -emit-module-interface-path - %s %S/Inputs/imports-other.swift -I %S/Inputs/imports-clang-modules/ -I %t -verify -swift-version 5 -enable-library-evolution | %FileCheck -implicit-check-not BAD %s
// RUN: %target-swift-frontend -disable-implicit-concurrency-module-import -emit-module -o %t/empty.swiftmodule %S/../Inputs/empty.swift
// RUN: %target-swift-frontend -disable-implicit-concurrency-module-import -emit-module -o %t/emptyButWithLibraryEvolution.swiftmodule %S/../Inputs/empty.swift -enable-library-evolution
// RUN: %target-swift-frontend -disable-implicit-concurrency-module-import -typecheck -emit-module-interface-path - %s %S/Inputs/imports-other.swift -I %S/Inputs/imports-clang-modules/ -I %t -verify -swift-version 5 -enable-library-evolution | %FileCheck -implicit-check-not BAD %s


@_exported import empty // expected-warning {{module 'empty' was not compiled with library evolution support; using it means binary compatibility for 'imports' can't be guaranteed}}
Expand All @@ -24,7 +24,6 @@ import NotSoSecret2 // expected-warning {{'NotSoSecret2' inconsistently imported
// CHECK-NEXT: {{^}}import NotSoSecret{{$}}
// CHECK-NEXT: {{^}}import NotSoSecret2{{$}}
// CHECK-NEXT: {{^}}import Swift{{$}}
// CHECK-NEXT: {{^}}import _Concurrency{{$}}
// CHECK-NEXT: {{^}}@_exported import empty{{$}}
// CHECK-NEXT: {{^}}@_exported import emptyButWithLibraryEvolution{{$}}
// CHECK-NOT: import