Skip to content

Commit 80fe825

Browse files
authored
Merge pull request #36841 from davezarzycki/pr36841
[CMake] Unbreak minimal Swift builds
2 parents 87a771f + 654234a commit 80fe825

14 files changed

+59
-31
lines changed

include/swift/Basic/LangOptions.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -274,7 +274,8 @@ namespace swift {
274274
bool EnableInferPublicSendable = false;
275275

276276
/// Disable the implicit import of the _Concurrency module.
277-
bool DisableImplicitConcurrencyModuleImport = false;
277+
bool DisableImplicitConcurrencyModuleImport =
278+
!SWIFT_ENABLE_EXPERIMENTAL_CONCURRENCY;
278279

279280
/// Should we check the target OSs of serialized modules to see that they're
280281
/// new enough?

include/swift/Config.h.in

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,6 @@
88

99
#cmakedefine HAVE_PROC_PID_RUSAGE 1
1010

11+
#cmakedefine01 SWIFT_ENABLE_EXPERIMENTAL_CONCURRENCY
12+
1113
#endif // SWIFT_CONFIG_H

stdlib/cmake/modules/SwiftSource.cmake

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -260,6 +260,10 @@ function(_add_target_variant_swift_compile_flags
260260
list(APPEND result "-D" "INTERNAL_CHECKS_ENABLED")
261261
endif()
262262

263+
if(SWIFT_ENABLE_EXPERIMENTAL_CONCURRENCY)
264+
list(APPEND result "-D" "SWIFT_ENABLE_EXPERIMENTAL_CONCURRENCY")
265+
endif()
266+
263267
if(SWIFT_ENABLE_RUNTIME_FUNCTION_COUNTERS)
264268
list(APPEND result "-D" "SWIFT_ENABLE_RUNTIME_FUNCTION_COUNTERS")
265269
endif()

stdlib/private/StdlibUnittest/CMakeLists.txt

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,11 @@ if (NOT IS_BUILD_TYPE_OPTIMIZED)
1010
list(APPEND swift_stdlib_unittest_compile_flags "-DSWIFT_STDLIB_DEBUG")
1111
endif()
1212

13+
set(swift_stdlib_unittest_link_libraries "")
14+
if (SWIFT_ENABLE_EXPERIMENTAL_CONCURRENCY)
15+
list(APPEND swift_stdlib_unittest_link_libraries "swift_Concurrency")
16+
endif()
17+
1318
add_swift_target_library(swiftStdlibUnittest ${SWIFT_STDLIB_LIBRARY_BUILD_TYPES} IS_STDLIB
1419
# This file should be listed the first. Module name is inferred from the
1520
# filename.
@@ -46,6 +51,6 @@ add_swift_target_library(swiftStdlibUnittest ${SWIFT_STDLIB_LIBRARY_BUILD_TYPES}
4651
SWIFT_COMPILE_FLAGS ${swift_stdlib_unittest_compile_flags} ${SWIFT_STANDARD_LIBRARY_SWIFT_FLAGS}
4752
INSTALL_IN_COMPONENT stdlib-experimental
4853
DARWIN_INSTALL_NAME_DIR "${SWIFT_DARWIN_STDLIB_PRIVATE_INSTALL_NAME_DIR}"
49-
LINK_LIBRARIES swift_Concurrency)
54+
LINK_LIBRARIES ${swift_stdlib_unittest_link_libraries})
5055
set_source_files_properties(InspectValue.cpp PROPERTIES COMPILE_FLAGS -std=c++14)
5156

stdlib/private/StdlibUnittest/StdlibUnittest.swift

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -875,6 +875,7 @@ func _childProcess() {
875875
}
876876
}
877877

878+
#if SWIFT_ENABLE_EXPERIMENTAL_CONCURRENCY
878879
@inline(never)
879880
func _childProcessAsync() async {
880881
_installTrapInterceptor()
@@ -928,6 +929,7 @@ func _childProcessAsync() async {
928929
}
929930
}
930931
}
932+
#endif
931933

932934
class _ParentProcess {
933935
#if os(Windows)
@@ -1367,6 +1369,7 @@ class _ParentProcess {
13671369
}
13681370
}
13691371

1372+
#if SWIFT_ENABLE_EXPERIMENTAL_CONCURRENCY
13701373
internal func runOneTestAsync(
13711374
fullTestName: String,
13721375
testSuite: TestSuite,
@@ -1457,6 +1460,7 @@ class _ParentProcess {
14571460
return .xFail
14581461
}
14591462
}
1463+
#endif
14601464

14611465

14621466
func run() {
@@ -1531,6 +1535,7 @@ class _ParentProcess {
15311535
}
15321536
}
15331537

1538+
#if SWIFT_ENABLE_EXPERIMENTAL_CONCURRENCY
15341539
func runAsync() async {
15351540
if let filter = _filter {
15361541
print("StdlibUnittest: using filter: \(filter)")
@@ -1602,6 +1607,7 @@ class _ParentProcess {
16021607
_testSuiteFailedCallback()
16031608
}
16041609
}
1610+
#endif
16051611

16061612
}
16071613

@@ -1713,6 +1719,7 @@ public func runAllTests() {
17131719
}
17141720
}
17151721

1722+
#if SWIFT_ENABLE_EXPERIMENTAL_CONCURRENCY
17161723
public func runAllTestsAsync() async {
17171724
if PersistentState.runNoTestsWasCalled {
17181725
print("runAllTests() called after runNoTests(). Aborting.")
@@ -1780,6 +1787,7 @@ public func runAllTestsAsync() async {
17801787
await parent.runAsync()
17811788
}
17821789
}
1790+
#endif
17831791

17841792
#if SWIFT_RUNTIME_ENABLE_LEAK_CHECKER
17851793

@@ -1816,6 +1824,7 @@ public final class TestSuite {
18161824
.code(testFunction)
18171825
}
18181826

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

18341844
// This method is prohibited from inlining because inlining the test harness
18351845
// into the test is not interesting from the runtime performance perspective.
@@ -1876,10 +1886,12 @@ public final class TestSuite {
18761886
code()
18771887
case .parameterized(code: let code, _):
18781888
code(parameter!)
1889+
#if SWIFT_ENABLE_EXPERIMENTAL_CONCURRENCY
18791890
case .singleAsync(_):
18801891
fatalError("Cannot call async code, use `runAllTestsAsync`")
18811892
case .parameterizedAsync(code: _, _):
18821893
fatalError("Cannot call async code, use `runAllTestsAsync`")
1894+
#endif
18831895
}
18841896

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

1909+
#if SWIFT_ENABLE_EXPERIMENTAL_CONCURRENCY
18971910
func _runTestAsync(name testName: String, parameter: Int?) async {
18981911
PersistentState.ranSomething = true
18991912
for r in _allResettables {
@@ -1917,13 +1930,15 @@ public final class TestSuite {
19171930
code()
19181931
case .parameterized(code: let code, _):
19191932
code(parameter!)
1933+
#if SWIFT_ENABLE_EXPERIMENTAL_CONCURRENCY
19201934
case .singleAsync(let code):
19211935
precondition(
19221936
parameter == nil,
19231937
"can't pass parameters to non-parameterized tests")
19241938
await code()
19251939
case .parameterizedAsync(code: let code, _):
19261940
await code(parameter!)
1941+
#endif
19271942
}
19281943

19291944
#if SWIFT_RUNTIME_ENABLE_LEAK_CHECKER
@@ -1937,6 +1952,7 @@ public final class TestSuite {
19371952
0, LifetimeTracked.instances, "Found leaked LifetimeTracked instances.",
19381953
file: test.testLoc.file, line: test.testLoc.line)
19391954
}
1955+
#endif
19401956

19411957
func _testByName(_ testName: String) -> _Test {
19421958
return _tests[_testNameToIndex[testName]!]
@@ -1956,8 +1972,10 @@ public final class TestSuite {
19561972
internal enum _TestCode {
19571973
case single(code: () -> Void)
19581974
case parameterized(code: (Int) -> Void, count: Int)
1975+
#if SWIFT_ENABLE_EXPERIMENTAL_CONCURRENCY
19591976
case singleAsync(code: () async -> Void)
19601977
case parameterizedAsync(code: (Int) async -> Void, count: Int)
1978+
#endif
19611979
}
19621980

19631981
internal struct _Test {
@@ -1991,10 +2009,12 @@ public final class TestSuite {
19912009
return [nil]
19922010
case .parameterized(code: _, count: let count):
19932011
return Array(0..<count)
2012+
#if SWIFT_ENABLE_EXPERIMENTAL_CONCURRENCY
19942013
case .singleAsync:
19952014
return [nil]
19962015
case .parameterizedAsync(code: _, count: let count):
19972016
return Array(0..<count)
2017+
#endif
19982018
}
19992019
}
20002020
}
@@ -2063,9 +2083,11 @@ public final class TestSuite {
20632083
_build(.single(code: testFunction))
20642084
}
20652085

2086+
#if SWIFT_ENABLE_EXPERIMENTAL_CONCURRENCY
20662087
public func code(_ testFunction: @escaping () async -> Void) {
20672088
_build(.singleAsync(code: testFunction))
20682089
}
2090+
#endif
20692091

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

2101+
#if SWIFT_ENABLE_EXPERIMENTAL_CONCURRENCY
20792102
public func forEach<Data>(
20802103
in parameterSets: [Data],
20812104
testFunction: @escaping (Data) async -> Void
@@ -2084,6 +2107,7 @@ public final class TestSuite {
20842107
code: { (i: Int) in await testFunction(parameterSets[i]) },
20852108
count: parameterSets.count))
20862109
}
2110+
#endif
20872111

20882112
}
20892113

test/IDE/Inputs/foo_swift_module.printed.comments.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import SwiftOnoneSupport
2-
import _Concurrency
32

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

test/IDE/print_module_comments.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// RUN: %empty-directory(%t)
22
//
33
// Build swift modules this test depends on.
4-
// 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
4+
// 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
55
//
66
// RUN: %target-swift-ide-test -print-module -source-filename %s -I %t -module-to-print=foo_swift_module > %t.printed.txt
77
// RUN: diff %t.printed.txt %S/Inputs/foo_swift_module.printed.comments.txt

test/Index/Store/cross-import-overlay.swift

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
// RUN: cp -r %S/../Inputs/CrossImport %t/CrossImport
44
// RUN: %{python} %S/../../CrossImport/Inputs/rewrite-module-triples.py %t/CrossImport %module-target-triple
55

6-
// 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
6+
// 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
77
// RUN: c-index-test core -print-unit %t/idx > %t/units
88

99
import A
@@ -30,7 +30,6 @@ from__ABAdditionsCAdditions()
3030
// MAIN-NEXT: is-debug: 1
3131
// MAIN-NEXT: DEPEND START
3232
// MAIN-NEXT: Unit | system | Swift | {{.*}}{{/|\\}}Swift.swiftmodule
33-
// MAIN-NEXT: Unit | system | _Concurrency | {{.*}}{{/|\\}}_Concurrency.swiftmodule
3433
// MAIN-NEXT: Unit | system | B | {{.*}}{{/|\\}}B.swiftmodule{{/|\\}}{{.*}}
3534
// MAIN-NEXT: Unit | system | C | {{.*}}{{/|\\}}C.swiftmodule{{/|\\}}{{.*}}
3635
// MAIN-NEXT: Unit | system | A | {{.*}}{{/|\\}}__ABAdditionsCAdditions.swiftmodule{{/|\\}}{{.*}}

test/Index/Store/unit-from-compile.swift

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// RUN: %empty-directory(%t)
2-
// RUN: %target-swift-frontend -c -index-store-path %t/idx %s -o %t/file1.o -module-name some_module_test
2+
// 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
33
// RUN: c-index-test core -print-unit %t/idx | %FileCheck %s
4-
// RUN: %target-swift-frontend -c -index-store-path %t/idx_opt %s -o %t/file1.o -module-name some_module_test -O
4+
// 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
55
// RUN: c-index-test core -print-unit %t/idx | %FileCheck %s -check-prefix=OPT
66

77
// CHECK: file1.o
@@ -16,7 +16,6 @@
1616

1717
// CHECK: DEPEND START
1818
// CHECK: Unit | system | {{.*}}{{/|\\}}Swift.swiftmodule
19-
// CHECK: Unit | system | _Concurrency
20-
// CHECK: DEPEND END (2)
19+
// CHECK: DEPEND END (1)
2120

2221
// OPT: is-debug: 1

test/Index/Store/unit-one-file-multi-file-invocation.swift

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// RUN: %empty-directory(%t)
2-
// 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
2+
// 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
33
// RUN: c-index-test core -print-unit %t/idx | %FileCheck %s -implicit-check-not SwiftShims
44

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

1514
// CHECK: [[SWIFT]]
1615
// CHECK: DEPEND START

test/Index/Store/unit-pcm-dependency.swift

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
// RUN: rm -rf %t
2-
// 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
2+
// 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
33
// RUN: c-index-test core -print-unit %t/idx | %FileCheck %s -check-prefix=FILE1
44

55
// If the module cache already exists, the pcm gets indexed.
66
// RUN: rm -rf %t/idx
7-
// 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
7+
// 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
88
// RUN: c-index-test core -print-unit %t/idx | %FileCheck %s -check-prefix=FILE1
99

1010
// FIXME: index the bridging header!
1111

1212
// RUN: %empty-directory(%t)
1313
// RUN: echo 'import ClangModuleA' > %t/s2.swift
14-
// 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
14+
// 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
1515
// RUN: c-index-test core -print-unit %t/idx > %t/both.txt
1616
// RUN: %FileCheck %s -check-prefix=FILE1 < %t/both.txt
1717
// RUN: %FileCheck %s -check-prefix=FILE2 < %t/both.txt
@@ -50,14 +50,13 @@ func test() {
5050
// FILE1-NOT: ClangModuleA.h
5151
// FILE1-NOT: Unit |{{.*}}ClangModuleA
5252
// FILE1: Unit | system | Swift | {{.*}}Swift.swiftmodule
53-
// FILE1: Unit | system | _Concurrency
5453
// FILE1-NOT: Unit |{{.*}}ClangModuleA
5554
// FILE1: Unit | user | ClangModuleB | {{.*}}ClangModuleB-{{[A-Z0-9]*}}.pcm | ClangModuleB-{{[A-Z0-9]*}}.pcm-
5655
// FILE1: Unit | user | ClangModuleC | {{.*}}ClangModuleC-{{[A-Z0-9]*}}.pcm | ClangModuleC-{{[A-Z0-9]*}}.pcm-
5756
// FILE1-NOT: Unit |{{.*}}ClangModuleA
5857
// FILE1: Record | user | {{.*}}unit-pcm-dependency.swift | unit-pcm-dependency.swift-
5958
// FILE1-NOT: Unit |{{.*}}ClangModuleA
60-
// FILE1: DEPEND END (5)
59+
// FILE1: DEPEND END (4)
6160

6261
// FILE2-NOT: main.swiftmodule-
6362

test/Index/Store/unit-with-bridging-header.swift

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
// RUN: %empty-directory(%t)
2-
// 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
3-
// 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
2+
// 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
3+
// 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
44
// RUN: c-index-test core -print-record %t/idx | %FileCheck %s --check-prefix=PCH-RECORD
55
// RUN: c-index-test core -print-unit %t/idx | %FileCheck %s --check-prefix=PCH-UNIT
6-
// 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
6+
// 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
77
// RUN: c-index-test core -print-unit %t/idx2 | %FileCheck --check-prefix=TEXTUAL-UNIT %s
88

99
// PCH-RECORD: bridge-include.h
@@ -32,16 +32,15 @@
3232
// PCH-UNIT: DEPEND START
3333
// PCH-UNIT: Unit | system | {{.*}}Swift.swiftmodule
3434
// PCH-UNIT: Unit | user | {{.*}}bridge-head.pch | bridge-head.pch-
35-
// PCH-UNIT: Unit | system | _Concurrency |
3635
// PCH-UNIT: Record | user | {{.*}}unit-with-bridging-header.swift | unit-with-bridging-header.swift-
37-
// PCH-UNIT: DEPEND END (4)
36+
// PCH-UNIT: DEPEND END (3)
3837

3938
// TEXTUAL-UNIT: s1.o-
4039
// TEXTUAL-UNIT: --------
4140
// TEXTUAL-UNIT: has-main: 1
4241
// TEXTUAL-UNIT: DEPEND START
4342
// TEXTUAL-UNIT: Unit | system | {{.*}}Swift.swiftmodule
4443
// TEXTUAL-UNIT: Record | user | {{.*}}unit-with-bridging-header.swift | unit-with-bridging-header.swift-
45-
// TEXTUAL-UNIT: DEPEND END (3)
44+
// TEXTUAL-UNIT: DEPEND END (2)
4645

4746
func test() {}

test/ModuleInterface/imports-submodule-order.swift

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
// RUN: %target-swift-frontend -typecheck -emit-module-interface-path - %s -I %S/Inputs/imports-submodule-order/ | %FileCheck %s
2-
// RUN: %target-swift-frontend -typecheck -emit-module-interface-path - %s -I %S/Inputs/imports-submodule-order/ -D XY | %FileCheck %s
1+
// RUN: %target-swift-frontend -disable-implicit-concurrency-module-import -typecheck -emit-module-interface-path - %s -I %S/Inputs/imports-submodule-order/ | %FileCheck %s
2+
// 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
33

44
#if XY
55
@_exported import X.Submodule
@@ -20,5 +20,4 @@
2020
// CHECK-NEXT: {{^}}import Swift{{$}}
2121
// CHECK-NEXT: import X{{$}}
2222
// CHECK-NEXT: import Y{{$}}
23-
// CHECK-NEXT: {{^}}import _Concurrency{{$}}
2423
// CHECK-NOT: import

test/ModuleInterface/imports.swift

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// RUN: %empty-directory(%t)
2-
// RUN: %target-swift-frontend -emit-module -o %t/empty.swiftmodule %S/../Inputs/empty.swift
3-
// RUN: %target-swift-frontend -emit-module -o %t/emptyButWithLibraryEvolution.swiftmodule %S/../Inputs/empty.swift -enable-library-evolution
4-
// 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
2+
// RUN: %target-swift-frontend -disable-implicit-concurrency-module-import -emit-module -o %t/empty.swiftmodule %S/../Inputs/empty.swift
3+
// RUN: %target-swift-frontend -disable-implicit-concurrency-module-import -emit-module -o %t/emptyButWithLibraryEvolution.swiftmodule %S/../Inputs/empty.swift -enable-library-evolution
4+
// 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
55

66

77
@_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}}
@@ -24,7 +24,6 @@ import NotSoSecret2 // expected-warning {{'NotSoSecret2' inconsistently imported
2424
// CHECK-NEXT: {{^}}import NotSoSecret{{$}}
2525
// CHECK-NEXT: {{^}}import NotSoSecret2{{$}}
2626
// CHECK-NEXT: {{^}}import Swift{{$}}
27-
// CHECK-NEXT: {{^}}import _Concurrency{{$}}
2827
// CHECK-NEXT: {{^}}@_exported import empty{{$}}
2928
// CHECK-NEXT: {{^}}@_exported import emptyButWithLibraryEvolution{{$}}
3029
// CHECK-NOT: import

0 commit comments

Comments
 (0)