Skip to content

Commit 5f70c17

Browse files
committed
Improve testFileMapMissingMainEntryWMO
I realized this test would pass even if the WMO arg was removed, which would negate the positive case. Now if that happens we fall back to -incremental and get the expected warning.
1 parent 6f8d795 commit 5f70c17

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

Tests/SwiftDriverTests/IncrementalCompilationTests.swift

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -299,10 +299,11 @@ extension IncrementalCompilationTests {
299299
"-module-name", module,
300300
"-o", derivedDataPath.appending(component: module + ".o").pathString,
301301
"-output-file-map", OFM.pathString,
302+
"-incremental",
302303
"-whole-module-optimization",
303304
"-no-color-diagnostics",
304305
] + inputPathsAndContents.map {$0.0.pathString}.sorted() + sdkArgumentsForTesting
305-
_ = try doABuild(whenAutolinking: [], expecting: [], arguments: args)
306+
_ = try doABuild(whenAutolinking: [], expecting: disabledForWMO, arguments: args)
306307
}
307308

308309
// FIXME: Expect failure in Linux in CI just as testIncrementalDiagnostics
@@ -1291,6 +1292,9 @@ extension DiagVerifiable {
12911292
@DiagsBuilder func disabledForRemoval(_ removedInput: String) -> [Diagnostic.Message] {
12921293
"Incremental compilation: Incremental compilation has been disabled, because the following inputs were used in the previous compilation but not in this one: \(removedInput).swift"
12931294
}
1295+
@DiagsBuilder var disabledForWMO: [Diagnostic.Message] {
1296+
"Incremental compilation has been disabled: it is not compatible with whole module optimization"
1297+
}
12941298
@DiagsBuilder var savedGraphNotFromPriorBuild: [Diagnostic.Message] {
12951299
.warning(
12961300
"Will not do cross-module incremental builds, priors saved at ")

0 commit comments

Comments
 (0)