Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't normalize *-unknown-windows-coff as *-unknown-windows-msvc #1558

Merged
merged 1 commit into from Mar 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion Sources/SwiftDriver/Utilities/Triple.swift
Expand Up @@ -126,7 +126,7 @@ public struct Triple {
parser.components.resize(toCount: 4, paddingWith: "")
parser.components[2] = "windows"
if parsedEnv?.value.environment == nil {
if let objectFormat = parsedEnv?.value.objectFormat, objectFormat != .coff {
if let objectFormat = parsedEnv?.value.objectFormat {
parser.components[3] = Substring(objectFormat.name)
} else {
parser.components[3] = "msvc"
Expand Down
4 changes: 4 additions & 0 deletions Tests/SwiftDriverTests/TripleTests.swift
Expand Up @@ -816,6 +816,9 @@ final class TripleTests: XCTestCase {

assertNormalizesEqual("i686-pc-windows-elf-elf",
"i686-pc-windows-elf")

assertNormalizesEqual("i686-unknown-windows-coff", "i686-unknown-windows-coff")
assertNormalizesEqual("x86_64-unknown-windows-coff", "x86_64-unknown-windows-coff")
}

func testNormalizeARM() {
Expand Down Expand Up @@ -1065,6 +1068,7 @@ final class TripleTests: XCTestCase {
XCTAssertEqual(.macho, Triple("i686---macho").objectFormat)

XCTAssertEqual(.coff, Triple("i686--win32").objectFormat)
XCTAssertEqual(.coff, Triple("i686-unknown-windows-coff").objectFormat)

XCTAssertEqual(.elf, Triple("i686-pc-windows-msvc-elf").objectFormat)
XCTAssertEqual(.elf, Triple("i686-pc-cygwin-elf").objectFormat)
Expand Down