Skip to content

Commit 1a642db

Browse files
committed
Generalize JobExecutorTests.testDarwinBasic to also pass on AppleSilicon.
1 parent bad19ac commit 1a642db

File tree

1 file changed

+5
-13
lines changed

1 file changed

+5
-13
lines changed

Tests/SwiftDriverTests/JobExecutorTests.swift

Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -95,13 +95,8 @@ extension DarwinToolchain {
9595

9696
final class JobExecutorTests: XCTestCase {
9797
func testDarwinBasic() throws {
98-
#if os(macOS)
99-
#if arch(arm64)
100-
// Disabled on Apple Silicon
101-
// rdar://76609781
102-
throw XCTSkip()
103-
#endif
104-
98+
#if os(macOS)
99+
let hostTriple = try Driver(args: ["swiftc", "test.swift"]).hostTriple
105100
let executor = try SwiftDriverExecutor(diagnosticsEngine: DiagnosticsEngine(),
106101
processSet: ProcessSet(),
107102
fileSystem: localFileSystem,
@@ -142,7 +137,7 @@ final class JobExecutorTests: XCTestCase {
142137
"-primary-file",
143138
.path(inputs[ "foo"]!.file),
144139
.path(inputs["main"]!.file),
145-
"-target", "x86_64-apple-darwin18.7.0",
140+
"-target", .flag(hostTriple.triple),
146141
"-enable-objc-interop",
147142
"-sdk",
148143
.path(.absolute(try toolchain.sdk.get())),
@@ -164,7 +159,7 @@ final class JobExecutorTests: XCTestCase {
164159
.path(.relative(RelativePath("foo.swift"))),
165160
"-primary-file",
166161
.path(inputs["main"]!.file),
167-
"-target", "x86_64-apple-darwin18.7.0",
162+
"-target", .flag(hostTriple.triple),
168163
"-enable-objc-interop",
169164
"-sdk",
170165
.path(.absolute(try toolchain.sdk.get())),
@@ -185,9 +180,7 @@ final class JobExecutorTests: XCTestCase {
185180
.path(.temporary(RelativePath("main.o"))),
186181
.path(.absolute(try toolchain.clangRT.get())),
187182
"-syslibroot", .path(.absolute(try toolchain.sdk.get())),
188-
"-lobjc", "-lSystem", "-arch", "x86_64",
189-
"-force_load", .path(.absolute(try toolchain.compatibility50.get())),
190-
"-force_load", .path(.absolute(try toolchain.compatibilityDynamicReplacements.get())),
183+
"-lobjc", "-lSystem", "-arch", .flag(hostTriple.archName),
191184
"-L", .path(.absolute(try toolchain.resourcesDirectory.get())),
192185
"-L", .path(.absolute(try toolchain.sdkStdlib(sdk: toolchain.sdk.get()))),
193186
"-rpath", "/usr/lib/swift", "-macosx_version_min", "10.14.0", "-no_objc_category_merging", "-o",
@@ -200,7 +193,6 @@ final class JobExecutorTests: XCTestCase {
200193
primaryInputs: [],
201194
outputs: [.init(file: VirtualPath.relative(RelativePath("main")).intern(), type: .image)]
202195
)
203-
204196
let delegate = JobCollectingDelegate()
205197
let executor = MultiJobExecutor(workload: .all([compileFoo, compileMain, link]),
206198
resolver: resolver, executorDelegate: delegate, diagnosticsEngine: DiagnosticsEngine())

0 commit comments

Comments
 (0)