@@ -3088,7 +3088,7 @@ final class SwiftDriverTests: XCTestCase {
3088
3088
func testWMOWithNonSourceInputFirstAndModuleOutput( ) throws {
3089
3089
var driver1 = try Driver ( args: [
3090
3090
" swiftc " , " -wmo " , " danger.o " , " foo.swift " , " bar.swift " , " wibble.swift " , " -module-name " , " Test " ,
3091
- " -driver-filelist-threshold=0 " , " -emit-module " , " -emit-library "
3091
+ " -driver-filelist-threshold=0 " , " -emit-module " , " -emit-library " , " -no-emit-module-separately-wmo "
3092
3092
] )
3093
3093
let plannedJobs = try driver1. planBuild ( ) . removingAutolinkExtractJobs ( )
3094
3094
XCTAssertEqual ( plannedJobs. count, 2 )
@@ -3467,6 +3467,22 @@ final class SwiftDriverTests: XCTestCase {
3467
3467
XCTAssertEqual ( plannedJobs. count, 4 )
3468
3468
XCTAssertEqual ( Set ( plannedJobs. map { $0. kind } ) , Set ( [ . compile, . emitModule, . link] ) )
3469
3469
}
3470
+
3471
+ do {
3472
+ // Schedule an emit-module separately job even if there are non-compilable inputs.
3473
+ var driver = try Driver ( args: [ " swiftc " , " foo.swift " , " bar.dylib " , " -emit-library " , " foo.dylib " , " -emit-module-path " , " foo.swiftmodule " ] ,
3474
+ env: envVars)
3475
+ let plannedJobs = try driver. planBuild ( )
3476
+ XCTAssertEqual ( plannedJobs. count, 3 )
3477
+ XCTAssertEqual ( Set ( plannedJobs. map { $0. kind } ) , Set ( [ . compile, . emitModule, . link] ) )
3478
+
3479
+ let emitJob = try plannedJobs. findJob ( . emitModule)
3480
+ XCTAssertTrue ( try emitJob. commandLine. contains ( where: { $0 == . path( . relative( try . init( validating: " foo.swift " ) ) ) } ) )
3481
+ XCTAssertFalse ( try emitJob. commandLine. contains ( where: { $0 == . path( . relative( try . init( validating: " bar.dylib " ) ) ) } ) )
3482
+
3483
+ let linkJob = try plannedJobs. findJob ( . link)
3484
+ XCTAssertTrue ( try linkJob. commandLine. contains ( where: { $0 == . path( . relative( try . init( validating: " bar.dylib " ) ) ) } ) )
3485
+ }
3470
3486
}
3471
3487
3472
3488
func testEmitModuleSeparatelyWMO( ) throws {
0 commit comments