Skip to content

Commit ba66fdc

Browse files
committed
[embedded] fix test and address review comments
1 parent 6e8ef82 commit ba66fdc

File tree

2 files changed

+7
-13
lines changed

2 files changed

+7
-13
lines changed

Sources/SwiftDriver/Jobs/CompileJob.swift

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -370,16 +370,10 @@ extension Driver {
370370
try commandLine.appendLast(.CrossModuleOptimization, from: &parsedOptions)
371371
try commandLine.appendLast(.ExperimentalPerformanceAnnotations, from: &parsedOptions)
372372

373-
if !embeddedEnabled {
374-
try commandLine.appendLast(.disableAutolinkingRuntimeCompatibility, from: &parsedOptions)
375-
try commandLine.appendLast(.runtimeCompatibilityVersion, from: &parsedOptions)
376-
try commandLine.appendLast(.disableAutolinkingRuntimeCompatibilityDynamicReplacements, from: &parsedOptions)
377-
try commandLine.appendLast(.disableAutolinkingRuntimeCompatibilityConcurrency, from: &parsedOptions)
378-
} else {
379-
try commandLine.appendFlag(.disableAutolinkingRuntimeCompatibility)
380-
try commandLine.appendFlag(.disableAutolinkingRuntimeCompatibilityDynamicReplacements)
381-
try commandLine.appendFlag(.disableAutolinkingRuntimeCompatibilityConcurrency)
382-
}
373+
try commandLine.appendLast(.runtimeCompatibilityVersion, from: &parsedOptions)
374+
try commandLine.appendLast(.disableAutolinkingRuntimeCompatibility, from: &parsedOptions)
375+
try commandLine.appendLast(.disableAutolinkingRuntimeCompatibilityDynamicReplacements, from: &parsedOptions)
376+
try commandLine.appendLast(.disableAutolinkingRuntimeCompatibilityConcurrency, from: &parsedOptions)
383377

384378
try commandLine.appendLast(.checkApiAvailabilityOnly, from: &parsedOptions)
385379

Tests/SwiftDriverTests/SwiftDriverTests.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6302,19 +6302,19 @@ final class SwiftDriverTests: XCTestCase {
63026302
let diags = DiagnosticsEngine()
63036303
var driver = try Driver(args: ["swiftc", "-target", "arm64-apple-macosx10.13", "test.swift", "-enable-experimental-feature", "Embedded", "-parse-as-library", "-wmo", "-o", "a.out", "-module-name", "main", "-enable-library-evolution"], diagnosticsEngine: diags)
63046304
_ = try driver.planBuild()
6305-
XCTAssertTrue(diags.diagnostics.first!.message.text == "Library evolution cannot be enabled with embedded Swift.")
6305+
XCTAssertTrue(diags.diagnostics.first!.message.text == error_no_library_evolution_embedded.message.text)
63066306
} catch _ { }
63076307
do {
63086308
let diags = DiagnosticsEngine()
63096309
var driver = try Driver(args: ["swiftc", "-target", "arm64-apple-macosx10.13", "test.swift", "-enable-experimental-feature", "Embedded", "-parse-as-library", "-o", "a.out", "-module-name", "main"], diagnosticsEngine: diags)
63106310
_ = try driver.planBuild()
6311-
XCTAssertTrue(diags.diagnostics.first!.message.text == "Whole module optimization (wmo) must be enabled with embedded Swift.")
6311+
XCTAssertTrue(diags.diagnostics.first!.message.text == error_need_wmo_embedded.message.text)
63126312
} catch _ { }
63136313
do {
63146314
let diags = DiagnosticsEngine()
63156315
var driver = try Driver(args: ["swiftc", "-target", "arm64-apple-macosx10.13", "test.swift", "-enable-experimental-feature", "Embedded", "-parse-as-library", "-wmo", "-o", "a.out", "-module-name", "main", "-enable-objc-interop"], diagnosticsEngine: diags)
63166316
_ = try driver.planBuild()
6317-
XCTAssertTrue(diags.diagnostics.first!.message.text == "Objective-C interop cannot be enabled with embedded Swift.")
6317+
XCTAssertTrue(diags.diagnostics.first!.message.text == error_no_objc_interop_embedded.message.text)
63186318
} catch _ { }
63196319
}
63206320

0 commit comments

Comments
 (0)