Skip to content

Commit

Permalink
Don't normalize *-unknown-windows-coff as *-unknown-windows-msvc (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
MaxDesiatov committed Mar 12, 2024
1 parent ab4c8ec commit eab7910
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
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

0 comments on commit eab7910

Please sign in to comment.