From 778c268594601435c25fec4547abb4ed48877945 Mon Sep 17 00:00:00 2001 From: Saleem Abdulrasool Date: Sun, 13 Dec 2015 05:27:45 +0000 Subject: [PATCH] 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 --- llvm/lib/Target/ARM/ARMAsmPrinter.cpp | 3 ++- llvm/test/CodeGen/ARM/Windows/no-eabi.ll | 10 ++++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) create mode 100644 llvm/test/CodeGen/ARM/Windows/no-eabi.ll diff --git a/llvm/lib/Target/ARM/ARMAsmPrinter.cpp b/llvm/lib/Target/ARM/ARMAsmPrinter.cpp index 61141c0031df..206db9619a2f 100644 --- a/llvm/lib/Target/ARM/ARMAsmPrinter.cpp +++ b/llvm/lib/Target/ARM/ARMAsmPrinter.cpp @@ -540,7 +540,8 @@ void ARMAsmPrinter::EmitEndOfAsmFile(Module &M) { MCTargetStreamer &TS = *OutStreamer->getTargetStreamer(); ARMTargetStreamer &ATS = static_cast(TS); - if (OptimizationGoals > 0) + if (OptimizationGoals > 0 && + (Subtarget->isTargetAEABI() || Subtarget->isTargetGNUAEABI())) ATS.emitAttribute(ARMBuildAttrs::ABI_optimization_goals, OptimizationGoals); OptimizationGoals = -1; diff --git a/llvm/test/CodeGen/ARM/Windows/no-eabi.ll b/llvm/test/CodeGen/ARM/Windows/no-eabi.ll new file mode 100644 index 000000000000..033ca0267ee0 --- /dev/null +++ b/llvm/test/CodeGen/ARM/Windows/no-eabi.ll @@ -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 +