Skip to content
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Sources/SwiftDriver/Utilities/Triple.swift
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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