Skip to content

Commit b2dfa87

Browse files
committed
Protect passing down the -no-verify flag on whether the frontend accepts it
rdar://123345345
1 parent 7bf84e3 commit b2dfa87

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

Sources/SwiftDriver/Jobs/FrontendJobHelpers.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -423,7 +423,8 @@ extension Driver {
423423
// Pass along -no-verify-emitted-module-interface only if it's effective.
424424
// Assume verification by default as we want to know only when the user skips
425425
// the verification.
426-
if !parsedOptions.hasFlag(positive: .verifyEmittedModuleInterface,
426+
if isFrontendArgSupported(.noVerifyEmittedModuleInterface) &&
427+
!parsedOptions.hasFlag(positive: .verifyEmittedModuleInterface,
427428
negative: .noVerifyEmittedModuleInterface,
428429
default: true) {
429430
commandLine.appendFlag("-no-verify-emitted-module-interface")

Tests/SwiftDriverTests/SwiftDriverTests.swift

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5621,7 +5621,9 @@ final class SwiftDriverTests: XCTestCase {
56215621
let plannedJobs = try driver.planBuild()
56225622
XCTAssertEqual(plannedJobs.count, 2)
56235623
let emitJob = try plannedJobs.findJob(.emitModule)
5624-
XCTAssertTrue(emitJob.commandLine.contains("-no-verify-emitted-module-interface"))
5624+
if driver.isFrontendArgSupported(.noVerifyEmittedModuleInterface) {
5625+
XCTAssertTrue(emitJob.commandLine.contains("-no-verify-emitted-module-interface"))
5626+
}
56255627
}
56265628

56275629
// Disabled by default in merge-module
@@ -5694,7 +5696,9 @@ final class SwiftDriverTests: XCTestCase {
56945696
let plannedJobs = try driver.planBuild()
56955697
XCTAssertEqual(plannedJobs.count, 1)
56965698
let compileJob = try plannedJobs.findJob(.compile)
5697-
XCTAssertTrue(compileJob.commandLine.contains("-no-verify-emitted-module-interface"))
5699+
if driver.isFrontendArgSupported(.noVerifyEmittedModuleInterface) {
5700+
XCTAssertTrue(compileJob.commandLine.contains("-no-verify-emitted-module-interface"))
5701+
}
56985702
}
56995703

57005704
// Enabled by default when the library-level is api.

0 commit comments

Comments
 (0)