Skip to content

Commit eab7910

Browse files
authored
Don't normalize *-unknown-windows-coff as *-unknown-windows-msvc (#1558)
1 parent ab4c8ec commit eab7910

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

Sources/SwiftDriver/Utilities/Triple.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ public struct Triple {
126126
parser.components.resize(toCount: 4, paddingWith: "")
127127
parser.components[2] = "windows"
128128
if parsedEnv?.value.environment == nil {
129-
if let objectFormat = parsedEnv?.value.objectFormat, objectFormat != .coff {
129+
if let objectFormat = parsedEnv?.value.objectFormat {
130130
parser.components[3] = Substring(objectFormat.name)
131131
} else {
132132
parser.components[3] = "msvc"

Tests/SwiftDriverTests/TripleTests.swift

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -816,6 +816,9 @@ final class TripleTests: XCTestCase {
816816

817817
assertNormalizesEqual("i686-pc-windows-elf-elf",
818818
"i686-pc-windows-elf")
819+
820+
assertNormalizesEqual("i686-unknown-windows-coff", "i686-unknown-windows-coff")
821+
assertNormalizesEqual("x86_64-unknown-windows-coff", "x86_64-unknown-windows-coff")
819822
}
820823

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

10671070
XCTAssertEqual(.coff, Triple("i686--win32").objectFormat)
1071+
XCTAssertEqual(.coff, Triple("i686-unknown-windows-coff").objectFormat)
10681072

10691073
XCTAssertEqual(.elf, Triple("i686-pc-windows-msvc-elf").objectFormat)
10701074
XCTAssertEqual(.elf, Triple("i686-pc-cygwin-elf").objectFormat)

0 commit comments

Comments
 (0)