From 577ce0d4e0af0489d531484baab8c94b7797f85a Mon Sep 17 00:00:00 2001 From: Martin Storsjo Date: Fri, 23 Mar 2018 09:10:03 +0000 Subject: [PATCH] [ARM] Error out on .arm assembler directives on windows Windows on arm is thumb only. Differential Revision: https://reviews.llvm.org/D43005 llvm-svn: 328298 --- lib/Target/ARM/MCTargetDesc/ARMMCTargetDesc.cpp | 7 +++++++ test/MC/ARM/arm-thumb-cpus.s | 3 +++ 2 files changed, 10 insertions(+) diff --git a/lib/Target/ARM/MCTargetDesc/ARMMCTargetDesc.cpp b/lib/Target/ARM/MCTargetDesc/ARMMCTargetDesc.cpp index ae5bc723ee5..7490a5cb8b8 100644 --- a/lib/Target/ARM/MCTargetDesc/ARMMCTargetDesc.cpp +++ b/lib/Target/ARM/MCTargetDesc/ARMMCTargetDesc.cpp @@ -153,6 +153,13 @@ std::string ARM_MC::ParseARMTriple(const Triple &TT, StringRef CPU) { ARMArchFeature += ",+nacl-trap"; } + if (TT.isOSWindows()) { + if (ARMArchFeature.empty()) + ARMArchFeature = "+noarm"; + else + ARMArchFeature += ",+noarm"; + } + return ARMArchFeature; } diff --git a/test/MC/ARM/arm-thumb-cpus.s b/test/MC/ARM/arm-thumb-cpus.s index 459b5c5fe00..7319f136347 100644 --- a/test/MC/ARM/arm-thumb-cpus.s +++ b/test/MC/ARM/arm-thumb-cpus.s @@ -17,6 +17,9 @@ @ RUN: | FileCheck %s --check-prefix=CHECK-THUMB-ONLY @ RUN: not llvm-mc -show-encoding -triple=armv6sm-eabi < %s 2>&1 \ +@ RUN: | FileCheck %s --check-prefix=CHECK-THUMB-ONLY + +@ RUN: not llvm-mc -show-encoding -triple=thumbv7-win32-gnu < %s 2>&1 \ @ RUN: | FileCheck %s --check-prefix=CHECK-THUMB-ONLY @ Make sure correct diagnostics are given for CPUs without support for