From: Christian Pirker Date: Fri, 28 Mar 2014 14:40:46 +0000 (+0000) Subject: Add ARM big endian Target (armeb, thumbeb) X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=37a9afe9ebdfc7643e4c15e8a7879bd5dec2aeb8;p=clang Add ARM big endian Target (armeb, thumbeb) Reviewed at http://llvm-reviews.chandlerc.com/D3096 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@205008 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Basic/Targets.cpp b/lib/Basic/Targets.cpp index a4be2891bd..b75114c97e 100644 --- a/lib/Basic/Targets.cpp +++ b/lib/Basic/Targets.cpp @@ -3707,19 +3707,29 @@ class ARMTargetInfo : public TargetInfo { T.getOS() != llvm::Triple::Bitrig) return false; StringRef ArchName = T.getArchName(); - if (T.getArch() == llvm::Triple::arm) { - if (!ArchName.startswith("armv")) + if (T.getArch() == llvm::Triple::arm || + T.getArch() == llvm::Triple::armeb) { + StringRef VersionStr; + if (ArchName.startswith("armv")) + VersionStr = ArchName.substr(4); + else if (ArchName.startswith("armebv")) + VersionStr = ArchName.substr(6); + else return false; - StringRef VersionStr = ArchName.substr(4); unsigned Version; if (VersionStr.getAsInteger(10, Version)) return false; return Version >= 6; } - assert(T.getArch() == llvm::Triple::thumb); - if (!ArchName.startswith("thumbv")) + assert(T.getArch() == llvm::Triple::thumb || + T.getArch() == llvm::Triple::thumbeb); + StringRef VersionStr; + if (ArchName.startswith("thumbv")) + VersionStr = ArchName.substr(6); + else if (ArchName.startswith("thumbebv")) + VersionStr = ArchName.substr(8); + else return false; - StringRef VersionStr = ArchName.substr(6); unsigned Version; if (VersionStr.getAsInteger(10, Version)) return false; @@ -3753,17 +3763,27 @@ class ARMTargetInfo : public TargetInfo { // Thumb1 add sp, #imm requires the immediate value be multiple of 4, // so set preferred for small types to 32. if (T.isOSBinFormatMachO()) - DescriptionString = "e-m:o-p:32:32-i1:8:32-i8:8:32-i16:16:32-i64:64-" - "v128:64:128-a:0:32-n32-S64"; + DescriptionString = BigEndian ? + "E-m:o-p:32:32-i1:8:32-i8:8:32-i16:16:32-i64:64-" + "v128:64:128-a:0:32-n32-S64" : + "e-m:o-p:32:32-i1:8:32-i8:8:32-i16:16:32-i64:64-" + "v128:64:128-a:0:32-n32-S64"; else - DescriptionString = "e-m:e-p:32:32-i1:8:32-i8:8:32-i16:16:32-i64:64-" - "v128:64:128-a:0:32-n32-S64"; + DescriptionString = BigEndian ? + "E-m:e-p:32:32-i1:8:32-i8:8:32-i16:16:32-i64:64-" + "v128:64:128-a:0:32-n32-S64" : + "e-m:e-p:32:32-i1:8:32-i8:8:32-i16:16:32-i64:64-" + "v128:64:128-a:0:32-n32-S64"; } else { if (T.isOSBinFormatMachO()) - DescriptionString = "e-m:o-p:32:32-i64:64-v128:64:128-n32-S64"; + DescriptionString = BigEndian ? + "E-m:o-p:32:32-i64:64-v128:64:128-n32-S64" : + "e-m:o-p:32:32-i64:64-v128:64:128-n32-S64"; else - DescriptionString = "e-m:e-p:32:32-i64:64-v128:64:128-n32-S64"; + DescriptionString = BigEndian ? + "E-m:e-p:32:32-i64:64-v128:64:128-n32-S64" : + "e-m:e-p:32:32-i64:64-v128:64:128-n32-S64"; } // FIXME: Enumerated types are variable width in straight AAPCS. @@ -3798,17 +3818,25 @@ class ARMTargetInfo : public TargetInfo { // Thumb1 add sp, #imm requires the immediate value be multiple of 4, // so set preferred for small types to 32. if (T.isOSBinFormatMachO()) - DescriptionString = "e-m:o-p:32:32-i1:8:32-i8:8:32-i16:16:32-f64:32:64" - "-v64:32:64-v128:32:128-a:0:32-n32-S32"; + DescriptionString = BigEndian ? + "E-m:o-p:32:32-i1:8:32-i8:8:32-i16:16:32-f64:32:64" + "-v64:32:64-v128:32:128-a:0:32-n32-S32" : + "e-m:o-p:32:32-i1:8:32-i8:8:32-i16:16:32-f64:32:64" + "-v64:32:64-v128:32:128-a:0:32-n32-S32"; else - DescriptionString = "e-m:e-p:32:32-i1:8:32-i8:8:32-i16:16:32-f64:32:64" - "-v64:32:64-v128:32:128-a:0:32-n32-S32"; + DescriptionString = BigEndian ? + "E-m:e-p:32:32-i1:8:32-i8:8:32-i16:16:32-f64:32:64" + "-v64:32:64-v128:32:128-a:0:32-n32-S32" : + "e-m:e-p:32:32-i1:8:32-i8:8:32-i16:16:32-f64:32:64" + "-v64:32:64-v128:32:128-a:0:32-n32-S32"; } else { if (T.isOSBinFormatMachO()) - DescriptionString = + DescriptionString = BigEndian ? + "E-m:o-p:32:32-f64:32:64-v64:32:64-v128:32:128-a:0:32-n32-S32" : "e-m:o-p:32:32-f64:32:64-v64:32:64-v128:32:128-a:0:32-n32-S32"; else - DescriptionString = + DescriptionString = BigEndian ? + "E-m:e-p:32:32-f64:32:64-v64:32:64-v128:32:128-a:0:32-n32-S32" : "e-m:e-p:32:32-f64:32:64-v64:32:64-v128:32:128-a:0:32-n32-S32"; } @@ -3816,10 +3844,11 @@ class ARMTargetInfo : public TargetInfo { } public: - ARMTargetInfo(const llvm::Triple &Triple) + ARMTargetInfo(const llvm::Triple &Triple, bool IsBigEndian) : TargetInfo(Triple), CPU("arm1136j-s"), FPMath(FP_Default), IsAAPCS(true) { - BigEndian = false; + BigEndian = IsBigEndian; + switch (getTriple().getOS()) { case llvm::Triple::NetBSD: PtrDiffType = SignedLong; @@ -3906,7 +3935,9 @@ public: // Enable the hwdiv extension for all v8a AArch32 cores by // default. ArchName == "armv8a" || ArchName == "armv8" || - ArchName == "thumbv8a" || ArchName == "thumbv8") { + ArchName == "armebv8a" || ArchName == "armebv8" || + ArchName == "thumbv8a" || ArchName == "thumbv8" || + ArchName == "thumbebv8a" || ArchName == "thumbebv8") { Features["hwdiv"] = true; Features["hwdiv-arm"] = true; } else if (CPU == "cortex-m3" || CPU == "cortex-m4") { @@ -4027,7 +4058,6 @@ public: Builder.defineMacro("__arm__"); // Target properties. - Builder.defineMacro("__ARMEL__"); Builder.defineMacro("__REGISTER_PREFIX__", ""); StringRef CPUArch = getCPUDefineSuffix(CPU); @@ -4299,11 +4329,34 @@ const Builtin::Info ARMTargetInfo::BuiltinInfo[] = { ALL_LANGUAGES }, #include "clang/Basic/BuiltinsARM.def" }; + +class ARMleTargetInfo : public ARMTargetInfo { +public: + ARMleTargetInfo(const llvm::Triple &Triple) + : ARMTargetInfo(Triple, false) { } + virtual void getTargetDefines(const LangOptions &Opts, + MacroBuilder &Builder) const { + Builder.defineMacro("__ARMEL__"); + ARMTargetInfo::getTargetDefines(Opts, Builder); + } +}; + +class ARMbeTargetInfo : public ARMTargetInfo { +public: + ARMbeTargetInfo(const llvm::Triple &Triple) + : ARMTargetInfo(Triple, true) { } + virtual void getTargetDefines(const LangOptions &Opts, + MacroBuilder &Builder) const { + Builder.defineMacro("__ARMEB__"); + Builder.defineMacro("__ARM_BIG_ENDIAN"); + ARMTargetInfo::getTargetDefines(Opts, Builder); + } +}; } // end anonymous namespace. namespace { class DarwinARMTargetInfo : - public DarwinTargetInfo { + public DarwinTargetInfo { protected: void getOSDefines(const LangOptions &Opts, const llvm::Triple &Triple, MacroBuilder &Builder) const override { @@ -4312,10 +4365,10 @@ protected: public: DarwinARMTargetInfo(const llvm::Triple &Triple) - : DarwinTargetInfo(Triple) { + : DarwinTargetInfo(Triple) { HasAlignMac68kSupport = true; // iOS always has 64-bit atomic instructions. - // FIXME: This should be based off of the target features in ARMTargetInfo. + // FIXME: This should be based off of the target features in ARMleTargetInfo. MaxAtomicInlineWidth = 64; // Darwin on iOS uses a variant of the ARM C++ ABI. @@ -5677,21 +5730,45 @@ static TargetInfo *AllocateTarget(const llvm::Triple &Triple) { switch (os) { case llvm::Triple::Linux: - return new LinuxTargetInfo(Triple); + return new LinuxTargetInfo(Triple); + case llvm::Triple::FreeBSD: + return new FreeBSDTargetInfo(Triple); + case llvm::Triple::NetBSD: + return new NetBSDTargetInfo(Triple); + case llvm::Triple::OpenBSD: + return new OpenBSDTargetInfo(Triple); + case llvm::Triple::Bitrig: + return new BitrigTargetInfo(Triple); + case llvm::Triple::RTEMS: + return new RTEMSTargetInfo(Triple); + case llvm::Triple::NaCl: + return new NaClTargetInfo(Triple); + default: + return new ARMleTargetInfo(Triple); + } + + case llvm::Triple::armeb: + case llvm::Triple::thumbeb: + if (Triple.isOSDarwin()) + return new DarwinARMTargetInfo(Triple); + + switch (os) { + case llvm::Triple::Linux: + return new LinuxTargetInfo(Triple); case llvm::Triple::FreeBSD: - return new FreeBSDTargetInfo(Triple); + return new FreeBSDTargetInfo(Triple); case llvm::Triple::NetBSD: - return new NetBSDTargetInfo(Triple); + return new NetBSDTargetInfo(Triple); case llvm::Triple::OpenBSD: - return new OpenBSDTargetInfo(Triple); + return new OpenBSDTargetInfo(Triple); case llvm::Triple::Bitrig: - return new BitrigTargetInfo(Triple); + return new BitrigTargetInfo(Triple); case llvm::Triple::RTEMS: - return new RTEMSTargetInfo(Triple); + return new RTEMSTargetInfo(Triple); case llvm::Triple::NaCl: - return new NaClTargetInfo(Triple); + return new NaClTargetInfo(Triple); default: - return new ARMTargetInfo(Triple); + return new ARMbeTargetInfo(Triple); } case llvm::Triple::msp430: diff --git a/lib/CodeGen/CGBuiltin.cpp b/lib/CodeGen/CGBuiltin.cpp index b0e63b647d..77138635f3 100644 --- a/lib/CodeGen/CGBuiltin.cpp +++ b/lib/CodeGen/CGBuiltin.cpp @@ -1641,7 +1641,9 @@ Value *CodeGenFunction::EmitTargetBuiltinExpr(unsigned BuiltinID, case llvm::Triple::aarch64_be: return EmitAArch64BuiltinExpr(BuiltinID, E); case llvm::Triple::arm: + case llvm::Triple::armeb: case llvm::Triple::thumb: + case llvm::Triple::thumbeb: return EmitARMBuiltinExpr(BuiltinID, E); case llvm::Triple::x86: case llvm::Triple::x86_64: diff --git a/lib/CodeGen/TargetInfo.cpp b/lib/CodeGen/TargetInfo.cpp index 7bac5121b1..ba85531dcf 100644 --- a/lib/CodeGen/TargetInfo.cpp +++ b/lib/CodeGen/TargetInfo.cpp @@ -5806,7 +5806,9 @@ const TargetCodeGenInfo &CodeGenModule::getTargetCodeGenInfo() { return *(TheTargetCodeGenInfo = new AArch64TargetCodeGenInfo(Types)); case llvm::Triple::arm: + case llvm::Triple::armeb: case llvm::Triple::thumb: + case llvm::Triple::thumbeb: { ARMABIInfo::ABIKind Kind = ARMABIInfo::AAPCS; if (strcmp(getTarget().getABI(), "apcs-gnu") == 0) diff --git a/lib/Driver/ToolChain.cpp b/lib/Driver/ToolChain.cpp index 9f756f7c63..6172296b63 100644 --- a/lib/Driver/ToolChain.cpp +++ b/lib/Driver/ToolChain.cpp @@ -161,8 +161,11 @@ bool ToolChain::isCrossCompiling() const { // The A32/T32/T16 instruction sets are not separate architectures in this // context. case llvm::Triple::arm: + case llvm::Triple::armeb: case llvm::Triple::thumb: - return getArch() != llvm::Triple::arm && getArch() != llvm::Triple::thumb; + case llvm::Triple::thumbeb: + return getArch() != llvm::Triple::arm && getArch() != llvm::Triple::thumb && + getArch() != llvm::Triple::armeb && getArch() != llvm::Triple::thumbeb; default: return HostTriple.getArch() != getArch(); } @@ -194,9 +197,13 @@ std::string ToolChain::ComputeLLVMTriple(const ArgList &Args, return Triple.getTriple(); } case llvm::Triple::arm: - case llvm::Triple::thumb: { + case llvm::Triple::armeb: + case llvm::Triple::thumb: + case llvm::Triple::thumbeb: { // FIXME: Factor into subclasses. llvm::Triple Triple = getTriple(); + bool IsBigEndian = getTriple().getArch() == llvm::Triple::armeb || + getTriple().getArch() == llvm::Triple::thumbeb; // Thumb2 is the default for V7 on Darwin. // @@ -207,12 +214,21 @@ std::string ToolChain::ComputeLLVMTriple(const ArgList &Args, bool ThumbDefault = Suffix.startswith("v6m") || Suffix.startswith("v7m") || Suffix.startswith("v7em") || (Suffix.startswith("v7") && getTriple().isOSBinFormatMachO()); - std::string ArchName = "arm"; + std::string ArchName; + if (IsBigEndian) + ArchName = "armeb"; + else + ArchName = "arm"; // Assembly files should start in ARM mode. if (InputType != types::TY_PP_Asm && Args.hasFlag(options::OPT_mthumb, options::OPT_mno_thumb, ThumbDefault)) - ArchName = "thumb"; + { + if (IsBigEndian) + ArchName = "thumbeb"; + else + ArchName = "thumb"; + } Triple.setArchName(ArchName + Suffix.str()); return Triple.getTriple(); diff --git a/lib/Driver/ToolChains.cpp b/lib/Driver/ToolChains.cpp index 4090a9ad1b..b348d6c24d 100644 --- a/lib/Driver/ToolChains.cpp +++ b/lib/Driver/ToolChains.cpp @@ -1313,6 +1313,11 @@ bool Generic_GCC::GCCInstallationDetector::getBiarchSibling(Multilib &M) const { "arm-linux-androideabi" }; static const char *const ARMHFTriples[] = { "arm-linux-gnueabihf", "armv7hl-redhat-linux-gnueabi" }; + static const char *const ARMebLibDirs[] = { "/lib" }; + static const char *const ARMebTriples[] = { "armeb-linux-gnueabi", + "armeb-linux-androideabi" }; + static const char *const ARMebHFTriples[] = { "armeb-linux-gnueabihf", + "armebv7hl-redhat-linux-gnueabi" }; static const char *const X86_64LibDirs[] = { "/lib64", "/lib" }; static const char *const X86_64Triples[] = { @@ -1405,6 +1410,17 @@ bool Generic_GCC::GCCInstallationDetector::getBiarchSibling(Multilib &M) const { ARMTriples + llvm::array_lengthof(ARMTriples)); } break; + case llvm::Triple::armeb: + case llvm::Triple::thumbeb: + LibDirs.append(ARMebLibDirs, ARMebLibDirs + llvm::array_lengthof(ARMebLibDirs)); + if (TargetTriple.getEnvironment() == llvm::Triple::GNUEABIHF) { + TripleAliases.append(ARMebHFTriples, + ARMebHFTriples + llvm::array_lengthof(ARMebHFTriples)); + } else { + TripleAliases.append(ARMebTriples, + ARMebTriples + llvm::array_lengthof(ARMebTriples)); + } + break; case llvm::Triple::x86_64: LibDirs.append(X86_64LibDirs, X86_64LibDirs + llvm::array_lengthof(X86_64LibDirs)); @@ -2068,7 +2084,9 @@ bool Generic_GCC::IsIntegratedAssemblerDefault() const { getTriple().getArch() == llvm::Triple::aarch64 || getTriple().getArch() == llvm::Triple::aarch64_be || getTriple().getArch() == llvm::Triple::arm || - getTriple().getArch() == llvm::Triple::thumb; + getTriple().getArch() == llvm::Triple::armeb || + getTriple().getArch() == llvm::Triple::thumb || + getTriple().getArch() == llvm::Triple::thumbeb; } void Generic_ELF::addClangTargetOptions(const ArgList &DriverArgs, @@ -2797,6 +2815,16 @@ static std::string getMultiarchTriple(const llvm::Triple &TargetTriple, return "arm-linux-gnueabi"; } return TargetTriple.str(); + case llvm::Triple::armeb: + case llvm::Triple::thumbeb: + if (TargetTriple.getEnvironment() == llvm::Triple::GNUEABIHF) { + if (llvm::sys::fs::exists(SysRoot + "/lib/armeb-linux-gnueabihf")) + return "armeb-linux-gnueabihf"; + } else { + if (llvm::sys::fs::exists(SysRoot + "/lib/armeb-linux-gnueabi")) + return "armeb-linux-gnueabi"; + } + return TargetTriple.str(); case llvm::Triple::x86: if (llvm::sys::fs::exists(SysRoot + "/lib/i386-linux-gnu")) return "i386-linux-gnu"; diff --git a/lib/Driver/Tools.cpp b/lib/Driver/Tools.cpp index 3106e1506b..2141cc9656 100644 --- a/lib/Driver/Tools.cpp +++ b/lib/Driver/Tools.cpp @@ -472,6 +472,7 @@ static bool isSignedCharDefault(const llvm::Triple &Triple) { case llvm::Triple::aarch64: case llvm::Triple::aarch64_be: case llvm::Triple::arm: + case llvm::Triple::armeb: case llvm::Triple::ppc: case llvm::Triple::ppc64: if (Triple.isOSDarwin()) @@ -1269,7 +1270,9 @@ static std::string getCPUName(const ArgList &Args, const llvm::Triple &T) { return getAArch64TargetCPU(Args, T); case llvm::Triple::arm: + case llvm::Triple::armeb: case llvm::Triple::thumb: + case llvm::Triple::thumbeb: return arm::getARMTargetCPU(Args, T); case llvm::Triple::mips: @@ -1478,7 +1481,9 @@ static void getTargetFeatures(const Driver &D, const llvm::Triple &Triple, break; case llvm::Triple::arm: + case llvm::Triple::armeb: case llvm::Triple::thumb: + case llvm::Triple::thumbeb: getARMTargetFeatures(D, Triple, Args, Features, ForAS); break; @@ -1770,7 +1775,8 @@ static void CollectArgsForIntegratedAssembler(Compilation &C, // Until ARM libraries are build separately, we have them all in one library static StringRef getArchNameForCompilerRTLib(const ToolChain &TC) { - if (TC.getArch() == llvm::Triple::arm) + if (TC.getArch() == llvm::Triple::arm || + TC.getArch() == llvm::Triple::armeb) return "arm"; else return TC.getArchName(); @@ -2260,7 +2266,9 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA, if (getToolChain().getTriple().getEnvironment() == llvm::Triple::Android) { switch (getToolChain().getTriple().getArch()) { case llvm::Triple::arm: + case llvm::Triple::armeb: case llvm::Triple::thumb: + case llvm::Triple::thumbeb: case llvm::Triple::mips: case llvm::Triple::mipsel: case llvm::Triple::mips64: @@ -2637,7 +2645,9 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA, break; case llvm::Triple::arm: + case llvm::Triple::armeb: case llvm::Triple::thumb: + case llvm::Triple::thumbeb: AddARMTargetArgs(Args, CmdArgs, KernelOrKext); break; @@ -4770,17 +4780,29 @@ const char *arm::getARMCPUForMArch(const ArgList &Args, .Cases("armv6m", "armv6-m", "cortex-m0") .Case("thumbv6m", "cortex-m0") .Cases("armv7", "armv7a", "armv7-a", "cortex-a8") + .Cases("armebv7", "armebv7a", "armebv7-a", "cortex-a8") .Cases("thumbv7", "thumbv7a", "cortex-a8") + .Cases("thumbebv7", "thumbebv7a", "cortex-a8") .Cases("armv7l", "armv7-l", "cortex-a8") + .Cases("armebv7l", "armebv7-l", "cortex-a8") .Cases("armv7s", "armv7-s", "swift") + .Cases("armebv7s", "armebv7-s", "swift") .Cases("armv7r", "armv7-r", "cortex-r4") + .Cases("armebv7r", "armebv7-r", "cortex-r4") .Case("thumbv7r", "cortex-r4") + .Case("thumbebv7r", "cortex-r4") .Cases("armv7m", "armv7-m", "cortex-m3") + .Cases("armebv7m", "armebv7-m", "cortex-m3") .Case("thumbv7m", "cortex-m3") + .Case("thumbebv7m", "cortex-m3") .Cases("armv7em", "armv7e-m", "cortex-m4") + .Cases("armebv7em", "armebv7e-m", "cortex-m4") .Cases("thumbv7em", "thumbv7e-m", "cortex-m4") + .Cases("thumbebv7em", "thumbebv7e-m", "cortex-m4") .Cases("armv8", "armv8a", "armv8-a", "cortex-a53") + .Cases("armebv8", "armebv8a", "armebv8-a", "cortex-a53") .Cases("thumbv8", "thumbv8a", "cortex-a53") + .Cases("thumbebv8", "thumbebv8a", "cortex-a53") .Case("ep9312", "ep9312") .Case("iwmmxt", "iwmmxt") .Case("xscale", "xscale") @@ -6027,7 +6049,9 @@ void freebsd::Assemble::ConstructJob(Compilation &C, const JobAction &JA, addAssemblerKPIC(Args, CmdArgs); } else if (getToolChain().getArch() == llvm::Triple::arm || - getToolChain().getArch() == llvm::Triple::thumb) { + getToolChain().getArch() == llvm::Triple::armeb || + getToolChain().getArch() == llvm::Triple::thumb || + getToolChain().getArch() == llvm::Triple::thumbeb) { const Driver &D = getToolChain().getDriver(); const llvm::Triple &Triple = getToolChain().getTriple(); StringRef FloatABI = arm::getARMFloatABI(D, Args, Triple); @@ -6273,7 +6297,9 @@ void netbsd::Assemble::ConstructJob(Compilation &C, const JobAction &JA, CmdArgs.push_back("--32"); break; case llvm::Triple::arm: - case llvm::Triple::thumb: { + case llvm::Triple::armeb: + case llvm::Triple::thumb: + case llvm::Triple::thumbeb: { std::string MArch(arm::getARMTargetCPU(Args, getToolChain().getTriple())); CmdArgs.push_back(Args.MakeArgString("-mcpu=" + MArch)); break; @@ -6367,7 +6393,9 @@ void netbsd::Link::ConstructJob(Compilation &C, const JobAction &JA, CmdArgs.push_back("elf_i386"); break; case llvm::Triple::arm: + case llvm::Triple::armeb: case llvm::Triple::thumb: + case llvm::Triple::thumbeb: CmdArgs.push_back("-m"); switch (getToolChain().getTriple().getEnvironment()) { case llvm::Triple::EABI: @@ -6542,11 +6570,13 @@ void gnutools::Assemble::ConstructJob(Compilation &C, const JobAction &JA, CmdArgs.push_back("-64"); CmdArgs.push_back("-Av9a"); NeedsKPIC = true; - } else if (getToolChain().getArch() == llvm::Triple::arm) { + } else if (getToolChain().getArch() == llvm::Triple::arm || + getToolChain().getArch() == llvm::Triple::armeb) { StringRef MArch = getToolChain().getArchName(); if (MArch == "armv7" || MArch == "armv7a" || MArch == "armv7-a") CmdArgs.push_back("-mfpu=neon"); - if (MArch == "armv8" || MArch == "armv8a" || MArch == "armv8-a") + if (MArch == "armv8" || MArch == "armv8a" || MArch == "armv8-a" || + MArch == "armebv8" || MArch == "armebv8a" || MArch == "armebv8-a") CmdArgs.push_back("-mfpu=crypto-neon-fp-armv8"); StringRef ARMFloatABI = tools::arm::getARMFloatABI( @@ -6693,6 +6723,12 @@ static StringRef getLinuxDynamicLinker(const ArgList &Args, return "/lib/ld-linux-armhf.so.3"; else return "/lib/ld-linux.so.3"; + } else if (ToolChain.getArch() == llvm::Triple::armeb || + ToolChain.getArch() == llvm::Triple::thumbeb) { + if (ToolChain.getTriple().getEnvironment() == llvm::Triple::GNUEABIHF) + return "/lib/ld-linux-armhf.so.3"; /* TODO: check which dynamic linker name. */ + else + return "/lib/ld-linux.so.3"; /* TODO: check which dynamic linker name. */ } else if (ToolChain.getArch() == llvm::Triple::mips || ToolChain.getArch() == llvm::Triple::mipsel) return "/lib/ld.so.1"; @@ -6784,6 +6820,9 @@ void gnutools::Link::ConstructJob(Compilation &C, const JobAction &JA, else if (ToolChain.getArch() == llvm::Triple::arm || ToolChain.getArch() == llvm::Triple::thumb) CmdArgs.push_back("armelf_linux_eabi"); + else if (ToolChain.getArch() == llvm::Triple::armeb + || ToolChain.getArch() == llvm::Triple::thumbeb) + CmdArgs.push_back("armebelf_linux_eabi"); /* TODO: check which NAME. */ else if (ToolChain.getArch() == llvm::Triple::ppc) CmdArgs.push_back("elf32ppclinux"); else if (ToolChain.getArch() == llvm::Triple::ppc64) @@ -6817,7 +6856,9 @@ void gnutools::Link::ConstructJob(Compilation &C, const JobAction &JA, if (Args.hasArg(options::OPT_static)) { if (ToolChain.getArch() == llvm::Triple::arm || - ToolChain.getArch() == llvm::Triple::thumb) + ToolChain.getArch() == llvm::Triple::armeb || + ToolChain.getArch() == llvm::Triple::thumb || + ToolChain.getArch() == llvm::Triple::thumbeb) CmdArgs.push_back("-Bstatic"); else CmdArgs.push_back("-static"); @@ -6829,7 +6870,9 @@ void gnutools::Link::ConstructJob(Compilation &C, const JobAction &JA, } if (ToolChain.getArch() == llvm::Triple::arm || + ToolChain.getArch() == llvm::Triple::armeb || ToolChain.getArch() == llvm::Triple::thumb || + ToolChain.getArch() == llvm::Triple::thumbeb || (!Args.hasArg(options::OPT_static) && !Args.hasArg(options::OPT_shared))) { CmdArgs.push_back("-dynamic-linker"); diff --git a/lib/Sema/SemaChecking.cpp b/lib/Sema/SemaChecking.cpp index f0e93a78f7..32bf6e01c9 100644 --- a/lib/Sema/SemaChecking.cpp +++ b/lib/Sema/SemaChecking.cpp @@ -303,7 +303,9 @@ Sema::CheckBuiltinFunctionCall(unsigned BuiltinID, CallExpr *TheCall) { if (BuiltinID >= Builtin::FirstTSBuiltin) { switch (Context.getTargetInfo().getTriple().getArch()) { case llvm::Triple::arm: + case llvm::Triple::armeb: case llvm::Triple::thumb: + case llvm::Triple::thumbeb: if (CheckARMBuiltinFunctionCall(BuiltinID, TheCall)) return ExprError(); break; diff --git a/test/Driver/arm-cortex-cpus.c b/test/Driver/arm-cortex-cpus.c index ddfbc6e58c..242fe0d241 100644 --- a/test/Driver/arm-cortex-cpus.c +++ b/test/Driver/arm-cortex-cpus.c @@ -111,12 +111,25 @@ // RUN: %clang -target arm -march=armv8-a -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-V8A %s // CHECK-V8A: "-cc1"{{.*}} "-triple" "armv8-{{.*}}" "-target-cpu" "cortex-a53" +// RUN: %clang -target armebv8 -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-BE-V8A %s +// RUN: %clang -target armeb -march=armebv8 -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-BE-V8A %s +// RUN: %clang -target armebv8a -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-BE-V8A %s +// RUN: %clang -target armeb -march=armebv8a -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-BE-V8A %s +// RUN: %clang -target armeb -march=armebv8-a -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-BE-V8A %s +// CHECK-BE-V8A: "-cc1"{{.*}} "-triple" "armebv8-{{.*}}" "-target-cpu" "cortex-a53" + // RUN: %clang -target armv8 -mthumb -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-V8A-THUMB %s // RUN: %clang -target arm -march=armv8 -mthumb -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-V8A-THUMB %s // RUN: %clang -target armv8a -mthumb -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-V8A-THUMB %s // RUN: %clang -target arm -march=armv8a -mthumb -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-V8A-THUMB %s // CHECK-V8A-THUMB: "-cc1"{{.*}} "-triple" "thumbv8-{{.*}}" "-target-cpu" "cortex-a53" +// RUN: %clang -target armebv8 -mthumb -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-BE-V8A-THUMB %s +// RUN: %clang -target armeb -march=armebv8 -mthumb -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-BE-V8A-THUMB %s +// RUN: %clang -target armebv8a -mthumb -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-BE-V8A-THUMB %s +// RUN: %clang -target armeb -march=armebv8a -mthumb -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-BE-V8A-THUMB %s +// CHECK-BE-V8A-THUMB: "-cc1"{{.*}} "-triple" "thumbebv8-{{.*}}" "-target-cpu" "cortex-a53" + // ================== Check default Architecture on each Cortex CPU // RUN: %clang -target arm-linux-gnueabi -mcpu=cortex-a5 -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-CPUV7A %s // RUN: %clang -target arm-linux-gnueabi -mcpu=cortex-a7 -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-CPUV7A %s @@ -126,6 +139,14 @@ // RUN: %clang -target arm-linux-gnueabi -mcpu=cortex-a15 -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-CPUV7A %s // CHECK-CPUV7A: "-cc1"{{.*}} "-triple" "armv7-{{.*}} +// RUN: %clang -target armeb-linux-gnueabi -mcpu=cortex-a5 -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-BE-CPUV7A %s +// RUN: %clang -target armeb-linux-gnueabi -mcpu=cortex-a7 -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-BE-CPUV7A %s +// RUN: %clang -target armeb-linux-gnueabi -mcpu=cortex-a8 -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-BE-CPUV7A %s +// RUN: %clang -target armeb-linux-gnueabi -mcpu=cortex-a9 -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-BE-CPUV7A %s +// RUN: %clang -target armeb-linux-gnueabi -mcpu=cortex-a12 -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-BE-CPUV7A %s +// RUN: %clang -target armeb-linux-gnueabi -mcpu=cortex-a15 -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-BE-CPUV7A %s +// CHECK-BE-CPUV7A: "-cc1"{{.*}} "-triple" "armebv7-{{.*}} + // RUN: %clang -target arm-linux-gnueabi -mcpu=cortex-a5 -mthumb -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-CPUV7A-THUMB %s // RUN: %clang -target arm-linux-gnueabi -mcpu=cortex-a7 -mthumb -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-CPUV7A-THUMB %s // RUN: %clang -target arm-linux-gnueabi -mcpu=cortex-a8 -mthumb -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-CPUV7A-THUMB %s @@ -134,27 +155,57 @@ // RUN: %clang -target arm-linux-gnueabi -mcpu=cortex-a15 -mthumb -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-CPUV7A-THUMB %s // CHECK-CPUV7A-THUMB: "-cc1"{{.*}} "-triple" "thumbv7-{{.*}} +// RUN: %clang -target armeb-linux-gnueabi -mcpu=cortex-a5 -mthumb -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-BE-CPUV7A-THUMB %s +// RUN: %clang -target armeb-linux-gnueabi -mcpu=cortex-a7 -mthumb -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-BE-CPUV7A-THUMB %s +// RUN: %clang -target armeb-linux-gnueabi -mcpu=cortex-a8 -mthumb -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-BE-CPUV7A-THUMB %s +// RUN: %clang -target armeb-linux-gnueabi -mcpu=cortex-a9 -mthumb -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-BE-CPUV7A-THUMB %s +// RUN: %clang -target armeb-linux-gnueabi -mcpu=cortex-a12 -mthumb -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-BE-CPUV7A-THUMB %s +// RUN: %clang -target armeb-linux-gnueabi -mcpu=cortex-a15 -mthumb -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-BE-CPUV7A-THUMB %s +// CHECK-BE-CPUV7A-THUMB: "-cc1"{{.*}} "-triple" "thumbebv7-{{.*}} + // RUN: %clang -target arm-linux-gnueabi -mcpu=cortex-m0 -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-CPUV6M %s // CHECK-CPUV6M: "-cc1"{{.*}} "-triple" "thumbv6m-{{.*}} // RUN: %clang -target arm-linux-gnueabi -mcpu=cortex-m3 -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-CPUV7M %s // CHECK-CPUV7M: "-cc1"{{.*}} "-triple" "thumbv7m-{{.*}} +// RUN: %clang -target armeb-linux-gnueabi -mcpu=cortex-m3 -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-BE-CPUV7M %s +// CHECK-BE-CPUV7M: "-cc1"{{.*}} "-triple" "thumbebv7m-{{.*}} + // RUN: %clang -target arm-linux-gnueabi -mcpu=cortex-m4 -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-CPUV7EM %s // CHECK-CPUV7EM: "-cc1"{{.*}} "-triple" "thumbv7em-{{.*}} +// RUN: %clang -target armeb-linux-gnueabi -mcpu=cortex-m4 -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-BE-CPUV7EM %s +// CHECK-BE-CPUV7EM: "-cc1"{{.*}} "-triple" "thumbebv7em-{{.*}} + // RUN: %clang -target arm-linux-gnueabi -mcpu=cortex-r4 -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-CPUV7R %s // RUN: %clang -target arm-linux-gnueabi -mcpu=cortex-r5 -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-CPUV7R %s // CHECK-CPUV7R: "-cc1"{{.*}} "-triple" "armv7r-{{.*}} +// RUN: %clang -target armeb-linux-gnueabi -mcpu=cortex-r4 -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-BE-CPUV7R %s +// RUN: %clang -target armeb-linux-gnueabi -mcpu=cortex-r5 -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-BE-CPUV7R %s +// CHECK-BE-CPUV7R: "-cc1"{{.*}} "-triple" "armebv7r-{{.*}} + // RUN: %clang -target arm-linux-gnueabi -mcpu=cortex-r4 -mthumb -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-CPUV7R-THUMB %s // RUN: %clang -target arm-linux-gnueabi -mcpu=cortex-r5 -mthumb -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-CPUV7R-THUMB %s // CHECK-CPUV7R-THUMB: "-cc1"{{.*}} "-triple" "thumbv7r-{{.*}} +// RUN: %clang -target armeb-linux-gnueabi -mcpu=cortex-r4 -mthumb -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-BE-CPUV7R-THUMB %s +// RUN: %clang -target armeb-linux-gnueabi -mcpu=cortex-r5 -mthumb -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-BE-CPUV7R-THUMB %s +// CHECK-BE-CPUV7R-THUMB: "-cc1"{{.*}} "-triple" "thumbebv7r-{{.*}} + // RUN: %clang -target arm -mcpu=cortex-a53 -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-CPUV8A %s // RUN: %clang -target arm -mcpu=cortex-a57 -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-CPUV8A %s // CHECK-CPUV8A: "-cc1"{{.*}} "-triple" "armv8-{{.*}} +// RUN: %clang -target armeb -mcpu=cortex-a53 -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-BE-CPUV8A %s +// RUN: %clang -target armeb -mcpu=cortex-a57 -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-BE-CPUV8A %s +// CHECK-BE-CPUV8A: "-cc1"{{.*}} "-triple" "armebv8-{{.*}} + // RUN: %clang -target arm -mcpu=cortex-a53 -mthumb -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-CPUV8A-THUMB %s // RUN: %clang -target arm -mcpu=cortex-a57 -mthumb -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-CPUV8A-THUMB %s // CHECK-CPUV8A-THUMB: "-cc1"{{.*}} "-triple" "thumbv8-{{.*}} + +// RUN: %clang -target armeb -mcpu=cortex-a53 -mthumb -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-BE-CPUV8A-THUMB %s +// RUN: %clang -target armeb -mcpu=cortex-a57 -mthumb -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-BE-CPUV8A-THUMB %s +// CHECK-BE-CPUV8A-THUMB: "-cc1"{{.*}} "-triple" "thumbebv8-{{.*}} diff --git a/test/Preprocessor/init.c b/test/Preprocessor/init.c index 7b19ad3cdd..8f57d298c3 100644 --- a/test/Preprocessor/init.c +++ b/test/Preprocessor/init.c @@ -523,8 +523,10 @@ // // ARM-NOT:#define _LP64 // ARM:#define __APCS_32__ 1 +// ARM-NOT:#define __ARMEB__ 1 // ARM:#define __ARMEL__ 1 // ARM:#define __ARM_ARCH_6J__ 1 +// ARM-NOT:#define __ARM_BIG_ENDIAN 1 // ARM:#define __BYTE_ORDER__ __ORDER_LITTLE_ENDIAN__ // ARM:#define __CHAR16_TYPE__ unsigned short // ARM:#define __CHAR32_TYPE__ unsigned int @@ -619,13 +621,117 @@ // ARM:#define __arm 1 // ARM:#define __arm__ 1 +// RUN: %clang_cc1 -E -dM -ffreestanding -triple=armeb-none-none < /dev/null | FileCheck -check-prefix ARM-BE %s +// +// ARM-BE-NOT:#define _LP64 +// ARM-BE:#define __APCS_32__ 1 +// ARM-BE:#define __ARMEB__ 1 +// ARM-BE-NOT:#define __ARMEL__ 1 +// ARM-BE:#define __ARM_ARCH_6J__ 1 +// ARM-BE:#define __ARM_BIG_ENDIAN 1 +// ARM-BE:#define __BIG_ENDIAN__ 1 +// ARM-BE:#define __BYTE_ORDER__ __ORDER_BIG_ENDIAN__ +// ARM-BE:#define __CHAR16_TYPE__ unsigned short +// ARM-BE:#define __CHAR32_TYPE__ unsigned int +// ARM-BE:#define __CHAR_BIT__ 8 +// ARM-BE:#define __DBL_DENORM_MIN__ 4.9406564584124654e-324 +// ARM-BE:#define __DBL_DIG__ 15 +// ARM-BE:#define __DBL_EPSILON__ 2.2204460492503131e-16 +// ARM-BE:#define __DBL_HAS_DENORM__ 1 +// ARM-BE:#define __DBL_HAS_INFINITY__ 1 +// ARM-BE:#define __DBL_HAS_QUIET_NAN__ 1 +// ARM-BE:#define __DBL_MANT_DIG__ 53 +// ARM-BE:#define __DBL_MAX_10_EXP__ 308 +// ARM-BE:#define __DBL_MAX_EXP__ 1024 +// ARM-BE:#define __DBL_MAX__ 1.7976931348623157e+308 +// ARM-BE:#define __DBL_MIN_10_EXP__ (-307) +// ARM-BE:#define __DBL_MIN_EXP__ (-1021) +// ARM-BE:#define __DBL_MIN__ 2.2250738585072014e-308 +// ARM-BE:#define __DECIMAL_DIG__ 17 +// ARM-BE:#define __FLT_DENORM_MIN__ 1.40129846e-45F +// ARM-BE:#define __FLT_DIG__ 6 +// ARM-BE:#define __FLT_EPSILON__ 1.19209290e-7F +// ARM-BE:#define __FLT_EVAL_METHOD__ 0 +// ARM-BE:#define __FLT_HAS_DENORM__ 1 +// ARM-BE:#define __FLT_HAS_INFINITY__ 1 +// ARM-BE:#define __FLT_HAS_QUIET_NAN__ 1 +// ARM-BE:#define __FLT_MANT_DIG__ 24 +// ARM-BE:#define __FLT_MAX_10_EXP__ 38 +// ARM-BE:#define __FLT_MAX_EXP__ 128 +// ARM-BE:#define __FLT_MAX__ 3.40282347e+38F +// ARM-BE:#define __FLT_MIN_10_EXP__ (-37) +// ARM-BE:#define __FLT_MIN_EXP__ (-125) +// ARM-BE:#define __FLT_MIN__ 1.17549435e-38F +// ARM-BE:#define __FLT_RADIX__ 2 +// ARM-BE:#define __INT16_TYPE__ short +// ARM-BE:#define __INT32_TYPE__ int +// ARM-BE:#define __INT64_C_SUFFIX__ LL +// ARM-BE:#define __INT64_TYPE__ long long int +// ARM-BE:#define __INT8_TYPE__ char +// ARM-BE:#define __INTMAX_MAX__ 9223372036854775807LL +// ARM-BE:#define __INTMAX_TYPE__ long long int +// ARM-BE:#define __INTMAX_WIDTH__ 64 +// ARM-BE:#define __INTPTR_TYPE__ long int +// ARM-BE:#define __INTPTR_WIDTH__ 32 +// ARM-BE:#define __INT_MAX__ 2147483647 +// ARM-BE:#define __LDBL_DENORM_MIN__ 4.9406564584124654e-324L +// ARM-BE:#define __LDBL_DIG__ 15 +// ARM-BE:#define __LDBL_EPSILON__ 2.2204460492503131e-16L +// ARM-BE:#define __LDBL_HAS_DENORM__ 1 +// ARM-BE:#define __LDBL_HAS_INFINITY__ 1 +// ARM-BE:#define __LDBL_HAS_QUIET_NAN__ 1 +// ARM-BE:#define __LDBL_MANT_DIG__ 53 +// ARM-BE:#define __LDBL_MAX_10_EXP__ 308 +// ARM-BE:#define __LDBL_MAX_EXP__ 1024 +// ARM-BE:#define __LDBL_MAX__ 1.7976931348623157e+308L +// ARM-BE:#define __LDBL_MIN_10_EXP__ (-307) +// ARM-BE:#define __LDBL_MIN_EXP__ (-1021) +// ARM-BE:#define __LDBL_MIN__ 2.2250738585072014e-308L +// ARM-BE:#define __LONG_LONG_MAX__ 9223372036854775807LL +// ARM-BE:#define __LONG_MAX__ 2147483647L +// ARM-BE-NOT:#define __LP64__ +// ARM-BE:#define __POINTER_WIDTH__ 32 +// ARM-BE:#define __PTRDIFF_TYPE__ int +// ARM-BE:#define __PTRDIFF_WIDTH__ 32 +// ARM-BE:#define __REGISTER_PREFIX__ +// ARM-BE:#define __SCHAR_MAX__ 127 +// ARM-BE:#define __SHRT_MAX__ 32767 +// ARM-BE:#define __SIG_ATOMIC_WIDTH__ 32 +// ARM-BE:#define __SIZEOF_DOUBLE__ 8 +// ARM-BE:#define __SIZEOF_FLOAT__ 4 +// ARM-BE:#define __SIZEOF_INT__ 4 +// ARM-BE:#define __SIZEOF_LONG_DOUBLE__ 8 +// ARM-BE:#define __SIZEOF_LONG_LONG__ 8 +// ARM-BE:#define __SIZEOF_LONG__ 4 +// ARM-BE:#define __SIZEOF_POINTER__ 4 +// ARM-BE:#define __SIZEOF_PTRDIFF_T__ 4 +// ARM-BE:#define __SIZEOF_SHORT__ 2 +// ARM-BE:#define __SIZEOF_SIZE_T__ 4 +// ARM-BE:#define __SIZEOF_WCHAR_T__ 4 +// ARM-BE:#define __SIZEOF_WINT_T__ 4 +// ARM-BE:#define __SIZE_MAX__ 4294967295U +// ARM-BE:#define __SIZE_TYPE__ unsigned int +// ARM-BE:#define __SIZE_WIDTH__ 32 +// ARM-BE:#define __THUMB_INTERWORK__ 1 +// ARM-BE:#define __UINTMAX_TYPE__ long long unsigned int +// ARM-BE:#define __USER_LABEL_PREFIX__ _ +// ARM-BE:#define __WCHAR_MAX__ 4294967295U +// ARM-BE:#define __WCHAR_TYPE__ unsigned int +// ARM-BE:#define __WCHAR_WIDTH__ 32 +// ARM-BE:#define __WINT_TYPE__ int +// ARM-BE:#define __WINT_WIDTH__ 32 +// ARM-BE:#define __arm 1 +// ARM-BE:#define __arm__ 1 + // RUN: %clang_cc1 -E -dM -ffreestanding -triple=arm-none-linux-gnueabi -target-feature +soft-float -target-feature +soft-float-abi < /dev/null | FileCheck -check-prefix ARMEABISOFTFP %s // -// ARM-NOT:#define _LP64 +// ARMEABISOFTFP-NOT:#define _LP64 // ARMEABISOFTFP:#define __APCS_32__ 1 +// ARMEABISOFTFP-NOT:#define __ARMEB__ 1 // ARMEABISOFTFP:#define __ARMEL__ 1 // ARMEABISOFTFP:#define __ARM_ARCH 6 // ARMEABISOFTFP:#define __ARM_ARCH_6J__ 1 +// ARMEABISOFTFP-NOT:#define __ARM_BIG_ENDIAN 1 // ARMEABISOFTFP:#define __ARM_EABI__ 1 // ARMEABISOFTFP:#define __ARM_PCS 1 // ARMEABISOFTFP-NOT:#define __ARM_PCS_VFP 1 @@ -726,11 +832,13 @@ // RUN: %clang_cc1 -E -dM -ffreestanding -triple=arm-none-linux-gnueabi < /dev/null | FileCheck -check-prefix ARMEABIHARDFP %s // -// ARM-NOT:#define _LP64 +// ARMEABIHARDFP-NOT:#define _LP64 // ARMEABIHARDFP:#define __APCS_32__ 1 +// ARMEABIHARDFP-NOT:#define __ARMEB__ 1 // ARMEABIHARDFP:#define __ARMEL__ 1 // ARMEABIHARDFP:#define __ARM_ARCH 6 // ARMEABIHARDFP:#define __ARM_ARCH_6J__ 1 +// ARMEABIHARDFP-NOT:#define __ARM_BIG_ENDIAN 1 // ARMEABIHARDFP:#define __ARM_EABI__ 1 // ARMEABIHARDFP:#define __ARM_PCS 1 // ARMEABIHARDFP:#define __ARM_PCS_VFP 1 @@ -860,10 +968,18 @@ // ARMv8: #define __THUMB_INTERWORK__ 1 // ARMv8-NOT: #define __thumb2__ +// RUN: %clang_cc1 -E -dM -ffreestanding -triple=armebv8-none-none < /dev/null | FileCheck -check-prefix ARMebv8 %s +// ARMebv8: #define __THUMB_INTERWORK__ 1 +// ARMebv8-NOT: #define __thumb2__ + // RUN: %clang_cc1 -E -dM -ffreestanding -triple=thumbv8 < /dev/null | FileCheck -check-prefix Thumbv8 %s // Thumbv8: #define __THUMB_INTERWORK__ 1 // Thumbv8: #define __thumb2__ +// RUN: %clang_cc1 -E -dM -ffreestanding -triple=thumbebv8 < /dev/null | FileCheck -check-prefix Thumbebv8 %s +// Thumbebv8: #define __THUMB_INTERWORK__ 1 +// Thumbebv8: #define __thumb2__ + // RUN: %clang_cc1 -E -dM -ffreestanding -triple=thumbv5 < /dev/null | FileCheck -check-prefix Thumbv5 %s // Thumbv5: #define __THUMB_INTERWORK__ 1 // Thumbv5-NOT: #define __thumb2__ @@ -876,6 +992,10 @@ // Thumbv7: #define __THUMB_INTERWORK__ 1 // Thumbv7: #define __thumb2__ +// RUN: %clang_cc1 -E -dM -ffreestanding -triple=thumbebv7 < /dev/null | FileCheck -check-prefix Thumbebv7 %s +// Thumbebv7: #define __THUMB_INTERWORK__ 1 +// Thumbebv7: #define __thumb2__ + // // RUN: %clang_cc1 -E -dM -ffreestanding -triple=i386-none-none < /dev/null | FileCheck -check-prefix I386 %s //