ARM: only emit EABI attributes on EABI targets

EABI attributes should only be emitted on EABI targets.  This prevents the
emission of the optimization goals EABI attribute on Windows ARM.

llvm-svn: 255448
This commit is contained in:
Saleem Abdulrasool 2015-12-13 05:27:45 +00:00
parent 13ec697056
commit 778c268594
2 changed files with 12 additions and 1 deletions

View File

@ -540,7 +540,8 @@ void ARMAsmPrinter::EmitEndOfAsmFile(Module &M) {
MCTargetStreamer &TS = *OutStreamer->getTargetStreamer();
ARMTargetStreamer &ATS = static_cast<ARMTargetStreamer &>(TS);
if (OptimizationGoals > 0)
if (OptimizationGoals > 0 &&
(Subtarget->isTargetAEABI() || Subtarget->isTargetGNUAEABI()))
ATS.emitAttribute(ARMBuildAttrs::ABI_optimization_goals, OptimizationGoals);
OptimizationGoals = -1;

View File

@ -0,0 +1,10 @@
; RUN: llc -O3 -mtriple thumbv7-windows %s -filetype asm -o - | FileCheck -check-prefix CHECK-NONEABI %s
; RUN: llc -O3 -mtriple armv7--linux-gnueabi %s -filetype asm -o - | FileCheck -check-prefix CHECK-EABI %s
define arm_aapcs_vfpcc void @function() {
ret void
}
; CHECK-EABI: .eabi_attribute
; CHECK-NONEABI-NOT: .eabi_attribute