Teach getDefaultFormat that we only support ELF on some architectures.

This should bring the windows bots back.

It is a bit ugly, but it is better than what we had before: The triple would
say that the object format was COFF, but llc/llvm-mc would produce an ELF.

llvm-svn: 232683
This commit is contained in:
Rafael Espindola 2015-03-18 22:19:16 +00:00
parent 5ec5c9cafe
commit 242548906d
2 changed files with 20 additions and 0 deletions

View File

@ -439,6 +439,23 @@ static const char *getObjectFormatTypeName(Triple::ObjectFormatType Kind) {
}
static Triple::ObjectFormatType getDefaultFormat(const Triple &T) {
switch (T.getArch()) {
default:
break;
case Triple::hexagon:
case Triple::mips:
case Triple::mipsel:
case Triple::mips64:
case Triple::mips64el:
case Triple::r600:
case Triple::amdgcn:
case Triple::sparc:
case Triple::sparcv9:
case Triple::systemz:
case Triple::xcore:
return Triple::ELF;
}
if (T.isOSDarwin())
return Triple::MachO;
else if (T.isOSWindows())

View File

@ -5,6 +5,9 @@
; RUN: llc < %s -march=amdgcn -mcpu=carrizo -verify-machineinstrs -filetype=obj | llvm-readobj -s -symbols - | FileCheck --check-prefix=ELF %s
; RUN: llc < %s -march=amdgcn -mcpu=carrizo -verify-machineinstrs -o - | FileCheck --check-prefix=CONFIG --check-prefix=TYPICAL %s
; Test that we don't try to produce a COFF file on windows
; RUN: llc < %s -mtriple=amdgcn-pc-mingw -mcpu=SI -verify-machineinstrs -filetype=obj | llvm-readobj -s -symbols - | FileCheck --check-prefix=ELF %s
; ELF: Format: ELF32
; ELF: Name: .AMDGPU.config
; ELF: Type: SHT_PROGBITS