[llvm] r232683 - Teach getDefaultFormat that we only support ELF on some architectures.
Rafael Espindola
rafael.espindola at gmail.com
Wed Mar 18 15:19:17 PDT 2015
Author: rafael
Date: Wed Mar 18 17:19:16 2015
New Revision: 232683
URL: http://llvm.org/viewvc/llvm-project?rev=232683&view=rev
Log:
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.
Modified:
llvm/trunk/lib/Support/Triple.cpp
llvm/trunk/test/CodeGen/R600/elf.ll
Modified: llvm/trunk/lib/Support/Triple.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Support/Triple.cpp?rev=232683&r1=232682&r2=232683&view=diff
==============================================================================
--- llvm/trunk/lib/Support/Triple.cpp (original)
+++ llvm/trunk/lib/Support/Triple.cpp Wed Mar 18 17:19:16 2015
@@ -439,6 +439,23 @@ static const char *getObjectFormatTypeNa
}
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())
Modified: llvm/trunk/test/CodeGen/R600/elf.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/R600/elf.ll?rev=232683&r1=232682&r2=232683&view=diff
==============================================================================
--- llvm/trunk/test/CodeGen/R600/elf.ll (original)
+++ llvm/trunk/test/CodeGen/R600/elf.ll Wed Mar 18 17:19:16 2015
@@ -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
More information about the llvm-commits
mailing list