@@ -3096,7 +3096,7 @@ final class SwiftDriverTests: XCTestCase {
3096
3096
func testWMOWithNonSourceInputFirstAndModuleOutput( ) throws {
3097
3097
var driver1 = try Driver ( args: [
3098
3098
" swiftc " , " -wmo " , " danger.o " , " foo.swift " , " bar.swift " , " wibble.swift " , " -module-name " , " Test " ,
3099
- " -driver-filelist-threshold=0 " , " -emit-module " , " -emit-library "
3099
+ " -driver-filelist-threshold=0 " , " -emit-module " , " -emit-library " , " -no-emit-module-separately-wmo "
3100
3100
] )
3101
3101
let plannedJobs = try driver1. planBuild ( ) . removingAutolinkExtractJobs ( )
3102
3102
XCTAssertEqual ( plannedJobs. count, 2 )
@@ -3504,6 +3504,22 @@ final class SwiftDriverTests: XCTestCase {
3504
3504
XCTAssertEqual ( plannedJobs. count, 4 )
3505
3505
XCTAssertEqual ( Set ( plannedJobs. map { $0. kind } ) , Set ( [ . compile, . emitModule, . link] ) )
3506
3506
}
3507
+
3508
+ do {
3509
+ // Schedule an emit-module separately job even if there are non-compilable inputs.
3510
+ var driver = try Driver ( args: [ " swiftc " , " foo.swift " , " bar.dylib " , " -emit-library " , " foo.dylib " , " -emit-module-path " , " foo.swiftmodule " ] ,
3511
+ env: envVars)
3512
+ let plannedJobs = try driver. planBuild ( )
3513
+ XCTAssertEqual ( plannedJobs. count, 3 )
3514
+ XCTAssertEqual ( Set ( plannedJobs. map { $0. kind } ) , Set ( [ . compile, . emitModule, . link] ) )
3515
+
3516
+ let emitJob = try plannedJobs. findJob ( . emitModule)
3517
+ XCTAssertTrue ( emitJob. commandLine. contains ( try toPathOption ( " foo.swift " ) ) )
3518
+ XCTAssertFalse ( emitJob. commandLine. contains ( try toPathOption ( " bar.dylib " ) ) )
3519
+
3520
+ let linkJob = try plannedJobs. findJob ( . link)
3521
+ XCTAssertTrue ( linkJob. commandLine. contains ( try toPathOption ( " bar.dylib " ) ) )
3522
+ }
3507
3523
}
3508
3524
3509
3525
func testEmitModuleSeparatelyWMO( ) throws {
0 commit comments