Skip to content

Commit a1f5386

Browse files
committed
Skip testLinkFilelistWithDebugInfo off of macOS
Only the Apple-platforms support dsymutil and building/linking with the swiftmodule, therefore, this test only applies to running on macOS where we have dsymutil. I've also cleaned up the test a bit to make it a bit clearer what the goals were. We're trying to verify that the contents of the filelist passed into the link job contains only the expected object file and does not include the swiftmodule file. Fixes: rdar://144378596
1 parent 9b83358 commit a1f5386

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

Tests/SwiftDriverTests/SwiftDriverTests.swift

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3212,8 +3212,8 @@ final class SwiftDriverTests: XCTestCase {
32123212
}
32133213

32143214
func testLinkFilelistWithDebugInfo() throws {
3215-
#if os(Windows)
3216-
try XCTSkipIf(true, "platform linker does not support filelists")
3215+
#if !os(macOS)
3216+
try XCTSkipIf(true, "platform does not support dsymutil")
32173217
#endif
32183218
func getFileListElements(for filelistOpt: String, job: Job) -> [VirtualPath] {
32193219
guard let optIdx = job.commandLine.firstIndex(of: .flag(filelistOpt)) else {
@@ -3233,13 +3233,14 @@ final class SwiftDriverTests: XCTestCase {
32333233
}
32343234

32353235
var driver = try Driver(args: [
3236-
"swiftc", "-g", "/tmp/hello.swift", "-module-name", "Hello",
3236+
"swiftc", "-target", "arm64-apple-macosx15",
3237+
"-g", "/tmp/hello.swift", "-module-name", "Hello",
32373238
"-emit-library", "-driver-filelist-threshold=0"
32383239
])
32393240

32403241
let jobs = try driver.planBuild().removingAutolinkExtractJobs()
3241-
XCTAssertEqual(jobs.count, 4)
3242-
XCTAssertEqual(getFileListElements(for: "-filelist", job: jobs[2]),
3242+
let linkJob = try jobs.findJob(.link)
3243+
XCTAssertEqual(getFileListElements(for: "-filelist", job: linkJob),
32433244
[.temporary(try .init(validating: "hello-1.o"))])
32443245
}
32453246

0 commit comments

Comments
 (0)