<html>
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<p><br>
</p>
<br>
<div class="moz-cite-prefix">On 5/25/17 11:39 AM, Galina Kistanova
wrote:<br>
</div>
<blockquote
cite="mid:CAJ8eiNxPOcQKNKgpiGqNjJ4776c-0-xZX4J1vxaPX2W290Q-=Q@mail.gmail.com"
type="cite">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<div dir="ltr">Hello Jonathan,<br>
<br>
This commit broke one of our builders:<br>
<br>
<a moz-do-not-send="true"
href="http://lab.llvm.org:8011/builders/llvm-clang-x86_64-expensive-checks-win/builds/2608/steps/build-unified-tree/logs/stdio">http://lab.llvm.org:8011/builders/llvm-clang-x86_64-expensive-checks-win/builds/2608/steps/build-unified-tree/logs/stdio</a><br>
<br>
Please have a look at this?<br>
</div>
</blockquote>
<br>
r303898 should take care of that.<br>
<br>
<br>
Jon<br>
<br>
<blockquote
cite="mid:CAJ8eiNxPOcQKNKgpiGqNjJ4776c-0-xZX4J1vxaPX2W290Q-=Q@mail.gmail.com"
type="cite">
<div dir="ltr"><br>
Thanks<br>
<br>
Galina<br>
<div class="gmail_extra"><br>
<div class="gmail_quote">On Thu, May 25, 2017 at 8:42 AM,
Jonathan Roelofs via cfe-commits <span dir="ltr"><<a
moz-do-not-send="true"
href="mailto:cfe-commits@lists.llvm.org" target="_blank">cfe-commits@lists.llvm.org</a>></span>
wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0
.8ex;border-left:1px #ccc solid;padding-left:1ex">Author:
jroelofs<br>
Date: Thu May 25 10:42:13 2017<br>
New Revision: 303873<br>
<br>
URL: <a moz-do-not-send="true"
href="http://llvm.org/viewvc/llvm-project?rev=303873&view=rev"
rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-<wbr>project?rev=303873&view=rev</a><br>
Log:<br>
Don't defer to the GCC driver for linking arm-baremetal<br>
<br>
Also comes with a cmake cache for building the runtime
bits:<br>
<br>
$ cmake <normal cmake flags> \<br>
-DBAREMETAL_ARMV6M_SYSROOT=/<wbr>path/to/sysroot \<br>
-DBAREMETAL_ARMV7M_SYSROOT=/<wbr>path/to/sysroot \<br>
-DBAREMETAL_ARMV7EM_SYSROOT=/<wbr>path/to/sysroot \<br>
-C /path/to/clang/cmake/caches/<wbr>BaremetalARM.cmake
\<br>
/path/to/llvm<br>
<br>
<a moz-do-not-send="true"
href="https://reviews.llvm.org/D33259" rel="noreferrer"
target="_blank">https://reviews.llvm.org/<wbr>D33259</a><br>
<br>
Added:<br>
cfe/trunk/cmake/caches/<wbr>BaremetalARM.cmake<br>
cfe/trunk/lib/Driver/<wbr>ToolChains/BareMetal.cpp<br>
cfe/trunk/lib/Driver/<wbr>ToolChains/BareMetal.h<br>
cfe/trunk/test/Driver/Inputs/<wbr>baremetal_arm/<br>
cfe/trunk/test/Driver/Inputs/<wbr>baremetal_arm/include/<br>
cfe/trunk/test/Driver/Inputs/<wbr>baremetal_arm/include/c++/<br>
cfe/trunk/test/Driver/Inputs/<wbr>baremetal_arm/include/c++/5.0.<wbr>0/<br>
cfe/trunk/test/Driver/Inputs/<wbr>baremetal_arm/include/c++/5.0.<wbr>0/.keep<br>
cfe/trunk/test/Driver/Inputs/<wbr>baremetal_arm/include/c++/6.0.<wbr>0/<br>
cfe/trunk/test/Driver/Inputs/<wbr>baremetal_arm/include/c++/6.0.<wbr>0/.keep<br>
cfe/trunk/test/Driver/Inputs/<wbr>baremetal_arm/include/c++/v1/<br>
cfe/trunk/test/Driver/Inputs/<wbr>baremetal_arm/include/c++/v1/.<wbr>keep<br>
cfe/trunk/test/Driver/<wbr>baremetal.cpp<br>
Modified:<br>
cfe/trunk/lib/Driver/<wbr>CMakeLists.txt<br>
cfe/trunk/lib/Driver/Driver.<wbr>cpp<br>
cfe/trunk/lib/Driver/<wbr>ToolChains/Gnu.cpp<br>
cfe/trunk/lib/Driver/<wbr>ToolChains/Linux.cpp<br>
cfe/trunk/test/Frontend/gnu-<wbr>mcount.c<br>
<br>
Added: cfe/trunk/cmake/caches/<wbr>BaremetalARM.cmake<br>
URL: <a moz-do-not-send="true"
href="http://llvm.org/viewvc/llvm-project/cfe/trunk/cmake/caches/BaremetalARM.cmake?rev=303873&view=auto"
rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-<wbr>project/cfe/trunk/cmake/<wbr>caches/BaremetalARM.cmake?rev=<wbr>303873&view=auto</a><br>
==============================<wbr>==============================<wbr>==================<br>
--- cfe/trunk/cmake/caches/<wbr>BaremetalARM.cmake (added)<br>
+++ cfe/trunk/cmake/caches/<wbr>BaremetalARM.cmake Thu May
25 10:42:13 2017<br>
@@ -0,0 +1,50 @@<br>
+set(LLVM_TARGETS_TO_BUILD ARM;X86 CACHE STRING "")<br>
+<br>
+# Builtins<br>
+set(LLVM_BUILTIN_TARGETS "armv7m-none-eabi;armv6m-none-<wbr>eabi;armv7em-none-eabi"
CACHE STRING "Builtin Targets")<br>
+<br>
+set(BUILTINS_armv6m-none-<wbr>eabi_CMAKE_SYSROOT
${BAREMETAL_ARMV6M_SYSROOT} CACHE STRING "armv6m-none-eabi
Sysroot")<br>
+set(BUILTINS_armv6m-none-<wbr>eabi_CMAKE_SYSTEM_NAME
Generic CACHE STRING "armv6m-none-eabi System Name")<br>
+set(BUILTINS_armv6m-none-<wbr>eabi_COMPILER_RT_BAREMETAL_<wbr>BUILD
ON CACHE BOOL "armv6m-none-eabi Baremetal build")<br>
+set(BUILTINS_armv6m-none-<wbr>eabi_COMPILER_RT_OS_DIR
"baremetal" CACHE STRING "armv6m-none-eabi os dir")<br>
+<br>
+set(BUILTINS_armv7m-none-<wbr>eabi_CMAKE_SYSROOT
${BAREMETAL_ARMV7M_SYSROOT} CACHE STRING "armv7m-none-eabi
Sysroot")<br>
+set(BUILTINS_armv7m-none-<wbr>eabi_CMAKE_SYSTEM_NAME
Generic CACHE STRING "armv7m-none-eabi System Name")<br>
+set(BUILTINS_armv7m-none-<wbr>eabi_COMPILER_RT_BAREMETAL_<wbr>BUILD
ON CACHE BOOL "armv7m-none-eabi Baremetal build")<br>
+set(BUILTINS_armv7m-none-<wbr>eabi_CMAKE_C_FLAGS
"-mfpu=fp-armv8" CACHE STRING "armv7m-none-eabi C Flags")<br>
+set(BUILTINS_armv7m-none-<wbr>eabi_CMAKE_ASM_FLAGS
"-mfpu=fp-armv8" CACHE STRING "armv7m-none-eabi ASM
Flags")<br>
+set(BUILTINS_armv7m-none-<wbr>eabi_COMPILER_RT_OS_DIR
"baremetal" CACHE STRING "armv7m-none-eabi os dir")<br>
+<br>
+set(BUILTINS_armv7em-none-<wbr>eabi_CMAKE_SYSROOT
${BAREMETAL_ARMV7EM_SYSROOT} CACHE STRING
"armv7em-none-eabi Sysroot")<br>
+set(BUILTINS_armv7em-none-<wbr>eabi_CMAKE_SYSTEM_NAME
Generic CACHE STRING "armv7em-none-eabi System Name")<br>
+set(BUILTINS_armv7em-none-<wbr>eabi_COMPILER_RT_BAREMETAL_<wbr>BUILD
ON CACHE BOOL "armv7em-none-eabi Baremetal build")<br>
+set(BUILTINS_armv7em-none-<wbr>eabi_CMAKE_C_FLAGS
"-mfpu=fp-armv8" CACHE STRING "armv7em-none-eabi C Flags")<br>
+set(BUILTINS_armv7em-none-<wbr>eabi_CMAKE_ASM_FLAGS
"-mfpu=fp-armv8" CACHE STRING "armv7em-none-eabi ASM
Flags")<br>
+set(BUILTINS_armv7em-none-<wbr>eabi_COMPILER_RT_OS_DIR
"baremetal" CACHE STRING "armv7em-none-eabi os dir")<br>
+<br>
+set(LLVM_INSTALL_TOOLCHAIN_<wbr>ONLY ON CACHE BOOL "")<br>
+set(LLVM_TOOLCHAIN_TOOLS<br>
+ llc<br>
+ llvm-ar<br>
+ llvm-cxxfilt<br>
+ llvm-dwarfdump<br>
+ llvm-dsymutil<br>
+ llvm-nm<br>
+ llvm-objdump<br>
+ llvm-ranlib<br>
+ llvm-readobj<br>
+ llvm-size<br>
+ llvm-symbolizer<br>
+ opt<br>
+ CACHE STRING "")<br>
+<br>
+set(LLVM_DISTRIBUTION_<wbr>COMPONENTS<br>
+ clang<br>
+ lld<br>
+ clang-headers<br>
+ builtins-armv6m-none-eabi<br>
+ builtins-armv7m-none-eabi<br>
+ builtins-armv7em-none-eabi<br>
+ runtimes<br>
+ ${LLVM_TOOLCHAIN_TOOLS}<br>
+ CACHE STRING "")<br>
<br>
Modified: cfe/trunk/lib/Driver/<wbr>CMakeLists.txt<br>
URL: <a moz-do-not-send="true"
href="http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/CMakeLists.txt?rev=303873&r1=303872&r2=303873&view=diff"
rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-<wbr>project/cfe/trunk/lib/Driver/<wbr>CMakeLists.txt?rev=303873&r1=<wbr>303872&r2=303873&view=diff</a><br>
==============================<wbr>==============================<wbr>==================<br>
--- cfe/trunk/lib/Driver/<wbr>CMakeLists.txt (original)<br>
+++ cfe/trunk/lib/Driver/<wbr>CMakeLists.txt Thu May 25
10:42:13 2017<br>
@@ -30,6 +30,7 @@ add_clang_library(clangDriver<br>
ToolChains/AMDGPU.cpp<br>
ToolChains/AVR.cpp<br>
ToolChains/Bitrig.cpp<br>
+ ToolChains/BareMetal.cpp<br>
ToolChains/Clang.cpp<br>
ToolChains/CloudABI.cpp<br>
ToolChains/CommonArgs.cpp<br>
<br>
Modified: cfe/trunk/lib/Driver/Driver.<wbr>cpp<br>
URL: <a moz-do-not-send="true"
href="http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/Driver.cpp?rev=303873&r1=303872&r2=303873&view=diff"
rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-<wbr>project/cfe/trunk/lib/Driver/<wbr>Driver.cpp?rev=303873&r1=<wbr>303872&r2=303873&view=diff</a><br>
==============================<wbr>==============================<wbr>==================<br>
--- cfe/trunk/lib/Driver/Driver.<wbr>cpp (original)<br>
+++ cfe/trunk/lib/Driver/Driver.<wbr>cpp Thu May 25
10:42:13 2017<br>
@@ -22,6 +22,7 @@<br>
#include "ToolChains/FreeBSD.h"<br>
#include "ToolChains/Fuchsia.h"<br>
#include "ToolChains/Gnu.h"<br>
+#include "ToolChains/BareMetal.h"<br>
#include "ToolChains/Haiku.h"<br>
#include "ToolChains/Hexagon.h"<br>
#include "ToolChains/Lanai.h"<br>
@@ -3828,6 +3829,8 @@ const ToolChain
&Driver::getToolChain(co<br>
if (Target.getVendor() == llvm::Triple::Myriad)<br>
TC = llvm::make_unique<toolchains::<wbr>MyriadToolChain>(*this,
Target,<br>
Args);<br>
+ else if (toolchains::BareMetal::<wbr>handlesTarget(Target))<br>
+ TC = llvm::make_unique<toolchains::<wbr>BareMetal>(*this,
Target, Args);<br>
else if (Target.isOSBinFormatELF())<br>
TC = llvm::make_unique<toolchains::<wbr>Generic_ELF>(*this,
Target, Args);<br>
else if (Target.isOSBinFormatMachO())<br>
<br>
Added: cfe/trunk/lib/Driver/<wbr>ToolChains/BareMetal.cpp<br>
URL: <a moz-do-not-send="true"
href="http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/ToolChains/BareMetal.cpp?rev=303873&view=auto"
rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-<wbr>project/cfe/trunk/lib/Driver/<wbr>ToolChains/BareMetal.cpp?rev=<wbr>303873&view=auto</a><br>
==============================<wbr>==============================<wbr>==================<br>
--- cfe/trunk/lib/Driver/<wbr>ToolChains/BareMetal.cpp
(added)<br>
+++ cfe/trunk/lib/Driver/<wbr>ToolChains/BareMetal.cpp Thu
May 25 10:42:13 2017<br>
@@ -0,0 +1,209 @@<br>
+//===--- BaremMetal.cpp - Bare Metal ToolChain
------------------*- C++ -*-===//<br>
+//<br>
+// The LLVM Compiler Infrastructure<br>
+//<br>
+// This file is distributed under the University of
Illinois Open Source<br>
+// License. See LICENSE.TXT for details.<br>
+//<br>
+//===------------------------<wbr>------------------------------<wbr>----------------===//<br>
+<br>
+#include "BareMetal.h"<br>
+<br>
+#include "CommonArgs.h"<br>
+#include "InputInfo.h"<br>
+#include "Gnu.h"<br>
+<br>
+#include "clang/Basic/<wbr>VirtualFileSystem.h"<br>
+#include "clang/Driver/Compilation.h"<br>
+#include "clang/Driver/Driver.h"<br>
+#include "clang/Driver/<wbr>DriverDiagnostic.h"<br>
+#include "clang/Driver/Options.h"<br>
+#include "llvm/Option/ArgList.h"<br>
+#include "llvm/Support/Path.h"<br>
+#include "llvm/Support/raw_ostream.h"<br>
+<br>
+using namespace llvm::opt;<br>
+using namespace clang;<br>
+using namespace clang::driver;<br>
+using namespace clang::driver::tools;<br>
+using namespace clang::driver::toolchains;<br>
+<br>
+BareMetal::BareMetal(const Driver &D, const
llvm::Triple &Triple,<br>
+ const ArgList &Args)<br>
+ : ToolChain(D, Triple, Args) {<br>
+ getProgramPaths().push_back(<wbr>getDriver().getInstalledDir())<wbr>;<br>
+ if (getDriver().getInstalledDir() != getDriver().Dir)<br>
+ getProgramPaths().push_back(<wbr>getDriver().Dir);<br>
+}<br>
+<br>
+BareMetal::~BareMetal() {}<br>
+<br>
+/// Is the triple {arm,thumb}-none-none-{eabi,<wbr>eabihf}
?<br>
+static bool isARMBareMetal(const llvm::Triple
&Triple) {<br>
+ if (Triple.getArch() != llvm::Triple::arm &&<br>
+ Triple.getArch() != llvm::Triple::thumb)<br>
+ return false;<br>
+<br>
+ if (Triple.getVendor() != llvm::Triple::UnknownVendor)<br>
+ return false;<br>
+<br>
+ if (Triple.getOS() != llvm::Triple::UnknownOS)<br>
+ return false;<br>
+<br>
+ if (Triple.getEnvironment() != llvm::Triple::EABI
&&<br>
+ Triple.getEnvironment() != llvm::Triple::EABIHF)<br>
+ return false;<br>
+<br>
+ return true;<br>
+}<br>
+<br>
+bool BareMetal::handlesTarget(const llvm::Triple
&Triple) {<br>
+ return isARMBareMetal(Triple);<br>
+}<br>
+<br>
+Tool *BareMetal::buildLinker() const {<br>
+ return new tools::baremetal::Linker(*<wbr>this);<br>
+}<br>
+<br>
+std::string BareMetal::getThreadModel() const {<br>
+ return "single";<br>
+}<br>
+<br>
+bool BareMetal::<wbr>isThreadModelSupported(const
StringRef Model) const {<br>
+ return Model == "single";<br>
+}<br>
+<br>
+std::string BareMetal::getRuntimesDir() const {<br>
+ SmallString<128> Dir(getDriver().ResourceDir);<br>
+ llvm::sys::path::append(Dir, "lib", "baremetal");<br>
+ return Dir.str();<br>
+}<br>
+<br>
+void BareMetal::<wbr>AddClangSystemIncludeArgs(<wbr>const
ArgList &DriverArgs,<br>
+ ArgStringList
&CC1Args) const {<br>
+ if (DriverArgs.hasArg(options::<wbr>OPT_nostdinc))<br>
+ return;<br>
+<br>
+ if (!DriverArgs.hasArg(options::<wbr>OPT_nobuiltininc))
{<br>
+ SmallString<128> Dir(getDriver().ResourceDir);<br>
+ llvm::sys::path::append(Dir, "include");<br>
+ addSystemInclude(DriverArgs, CC1Args, Dir.str());<br>
+ }<br>
+<br>
+ if (!DriverArgs.hasArg(options::<wbr>OPT_nostdlibinc))
{<br>
+ SmallString<128> Dir(getDriver().SysRoot);<br>
+ llvm::sys::path::append(Dir, "include");<br>
+ addSystemInclude(DriverArgs, CC1Args, Dir.str());<br>
+ }<br>
+}<br>
+<br>
+void BareMetal::<wbr>addClangTargetOptions(const ArgList
&DriverArgs,<br>
+ ArgStringList
&CC1Args) const {<br>
+ CC1Args.push_back("-<wbr>nostdsysteminc");<br>
+}<br>
+<br>
+std::string BareMetal::<wbr>findLibCxxIncludePath(<wbr>CXXStdlibType
LibType) const {<br>
+ StringRef SysRoot = getDriver().SysRoot;<br>
+ if (SysRoot.empty())<br>
+ return "";<br>
+<br>
+ switch (LibType) {<br>
+ case ToolChain::CST_Libcxx: {<br>
+ SmallString<128> Dir(SysRoot);<br>
+ llvm::sys::path::append(Dir, "include", "c++", "v1");<br>
+ return Dir.str();<br>
+ }<br>
+ case ToolChain::CST_Libstdcxx: {<br>
+ SmallString<128> Dir(SysRoot);<br>
+ llvm::sys::path::append(Dir, "include", "c++");<br>
+ std::error_code EC;<br>
+ Generic_GCC::GCCVersion Version = {"", -1, -1, -1,
"", "", ""};<br>
+ // Walk the subdirs, and find the one with the newest
gcc version:<br>
+ for (vfs::directory_iterator LI =<br>
+ getDriver().getVFS().dir_<wbr>begin(Dir.str(),
EC), LE;<br>
+ !EC && LI != LE; LI = LI.increment(EC))
{<br>
+ StringRef VersionText =
llvm::sys::path::filename(LI-><wbr>getName());<br>
+ auto CandidateVersion = Generic_GCC::GCCVersion::<wbr>Parse(VersionText);<br>
+ if (CandidateVersion.Major == -1)<br>
+ continue;<br>
+ if (CandidateVersion <= Version)<br>
+ continue;<br>
+ Version = CandidateVersion;<br>
+ }<br>
+ if (Version.Major == -1)<br>
+ return "";<br>
+ llvm::sys::path::append(Dir, Version.Text);<br>
+ return Dir.str();<br>
+ }<br>
+ }<br>
+}<br>
+<br>
+void BareMetal::<wbr>AddClangCXXStdlibIncludeArgs(<br>
+ const ArgList &DriverArgs, ArgStringList
&CC1Args) const {<br>
+ if (DriverArgs.hasArg(options::<wbr>OPT_nostdinc) ||<br>
+ DriverArgs.hasArg(options::<wbr>OPT_nostdlibinc) ||<br>
+ DriverArgs.hasArg(options::<wbr>OPT_nostdincxx))<br>
+ return;<br>
+<br>
+ std::string Path = findLibCxxIncludePath(<wbr>GetCXXStdlibType(DriverArgs));<br>
+ if (!Path.empty())<br>
+ addSystemInclude(DriverArgs, CC1Args, Path);<br>
+}<br>
+<br>
+void BareMetal::<wbr>AddCXXStdlibLibArgs(const ArgList
&Args,<br>
+ ArgStringList
&CmdArgs) const {<br>
+ switch (GetCXXStdlibType(Args)) {<br>
+ case ToolChain::CST_Libcxx:<br>
+ CmdArgs.push_back("-lc++");<br>
+ CmdArgs.push_back("-lc++abi");<br>
+ break;<br>
+ case ToolChain::CST_Libstdcxx:<br>
+ CmdArgs.push_back("-lstdc++");<br>
+ CmdArgs.push_back("-lsupc++");<br>
+ break;<br>
+ }<br>
+ CmdArgs.push_back("-lunwind");<br>
+}<br>
+<br>
+void BareMetal::AddLinkRuntimeLib(<wbr>const ArgList
&Args,<br>
+ ArgStringList
&CmdArgs) const {<br>
+ CmdArgs.push_back(Args.<wbr>MakeArgString("-lclang_rt.<wbr>builtins-"
+<br>
+
getTriple().getArchName() + ".a"));<br>
+}<br>
+<br>
+void baremetal::Linker::<wbr>ConstructJob(Compilation
&C, const JobAction &JA,<br>
+ const InputInfo
&Output,<br>
+ const InputInfoList
&Inputs,<br>
+ const ArgList
&Args,<br>
+ const char
*LinkingOutput) const {<br>
+ ArgStringList CmdArgs;<br>
+<br>
+ auto &TC = static_cast<const
toolchains::BareMetal&>(<wbr>getToolChain());<br>
+<br>
+ AddLinkerInputs(TC, Inputs, Args, CmdArgs, JA);<br>
+<br>
+ CmdArgs.push_back("-Bstatic");<br>
+<br>
+ CmdArgs.push_back(Args.<wbr>MakeArgString("-L" +
TC.getRuntimesDir()));<br>
+<br>
+ Args.AddAllArgs(CmdArgs, {options::OPT_L,
options::OPT_T_Group,<br>
+ options::OPT_e,
options::OPT_s, options::OPT_t,<br>
+ options::OPT_Z_Flag,
options::OPT_r});<br>
+<br>
+ if (!Args.hasArg(options::OPT_<wbr>nostdlib,
options::OPT_nodefaultlibs)) {<br>
+ if (C.getDriver().CCCIsCXX())<br>
+ TC.AddCXXStdlibLibArgs(Args, CmdArgs);<br>
+<br>
+ CmdArgs.push_back("-lc");<br>
+ CmdArgs.push_back("-lm");<br>
+<br>
+ TC.AddLinkRuntimeLib(Args, CmdArgs);<br>
+ }<br>
+<br>
+ CmdArgs.push_back("-o");<br>
+ CmdArgs.push_back(Output.<wbr>getFilename());<br>
+<br>
+ C.addCommand(llvm::make_<wbr>unique<Command>(JA,
*this,<br>
+
Args.MakeArgString(TC.<wbr>GetLinkerPath()),<br>
+ CmdArgs,
Inputs));<br>
+}<br>
<br>
Added: cfe/trunk/lib/Driver/<wbr>ToolChains/BareMetal.h<br>
URL: <a moz-do-not-send="true"
href="http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/ToolChains/BareMetal.h?rev=303873&view=auto"
rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-<wbr>project/cfe/trunk/lib/Driver/<wbr>ToolChains/BareMetal.h?rev=<wbr>303873&view=auto</a><br>
==============================<wbr>==============================<wbr>==================<br>
--- cfe/trunk/lib/Driver/<wbr>ToolChains/BareMetal.h
(added)<br>
+++ cfe/trunk/lib/Driver/<wbr>ToolChains/BareMetal.h Thu
May 25 10:42:13 2017<br>
@@ -0,0 +1,90 @@<br>
+//===--- BareMetal.h - Bare Metal Tool and ToolChain
-------------*- C++ -*-===//<br>
+//<br>
+// The LLVM Compiler Infrastructure<br>
+//<br>
+// This file is distributed under the University of
Illinois Open Source<br>
+// License. See LICENSE.TXT for details.<br>
+//<br>
+//===------------------------<wbr>------------------------------<wbr>----------------===//<br>
+<br>
+#ifndef LLVM_CLANG_LIB_DRIVER_<wbr>TOOLCHAINS_BAREMETAL_H<br>
+#define LLVM_CLANG_LIB_DRIVER_<wbr>TOOLCHAINS_BAREMETAL_H<br>
+<br>
+#include "clang/Driver/Tool.h"<br>
+#include "clang/Driver/ToolChain.h"<br>
+<br>
+#include <string><br>
+<br>
+namespace clang {<br>
+namespace driver {<br>
+<br>
+namespace toolchains {<br>
+<br>
+class LLVM_LIBRARY_VISIBILITY BareMetal : public
ToolChain {<br>
+public:<br>
+ BareMetal(const Driver &D, const llvm::Triple
&Triple,<br>
+ const llvm::opt::ArgList &Args);<br>
+ ~BareMetal() override;<br>
+<br>
+ static bool handlesTarget(const llvm::Triple
&Triple);<br>
+protected:<br>
+ Tool *buildLinker() const override;<br>
+<br>
+public:<br>
+ bool useIntegratedAs() const override { return true; }<br>
+ bool isCrossCompiling() const override { return true; }<br>
+ bool isPICDefault() const override { return false; }<br>
+ bool isPIEDefault() const override { return false; }<br>
+ bool isPICDefaultForced() const override { return
false; }<br>
+ bool SupportsProfiling() const override { return false;
}<br>
+ bool SupportsObjCGC() const override { return false; }<br>
+ std::string getThreadModel() const override;<br>
+ bool isThreadModelSupported(const StringRef Model)
const override;<br>
+<br>
+ RuntimeLibType GetDefaultRuntimeLibType() const
override {<br>
+ return ToolChain::RLT_CompilerRT;<br>
+ }<br>
+ CXXStdlibType GetDefaultCXXStdlibType() const override
{<br>
+ return ToolChain::CST_Libcxx;<br>
+ }<br>
+<br>
+ const char *getDefaultLinker() const override { return
"ld.lld"; }<br>
+<br>
+ std::string getRuntimesDir() const;<br>
+ void AddClangSystemIncludeArgs(<wbr>const
llvm::opt::ArgList &DriverArgs,<br>
+ llvm::opt::ArgStringList
&CC1Args) const override;<br>
+ void addClangTargetOptions(const llvm::opt::ArgList
&DriverArgs,<br>
+ llvm::opt::ArgStringList
&CC1Args) const override;<br>
+ std::string findLibCxxIncludePath(<wbr>ToolChain::CXXStdlibType
LibType) const;<br>
+ void AddClangCXXStdlibIncludeArgs(<br>
+ const llvm::opt::ArgList &DriverArgs,<br>
+ llvm::opt::ArgStringList &CC1Args) const
override;<br>
+ void AddCXXStdlibLibArgs(const llvm::opt::ArgList
&Args,<br>
+ llvm::opt::ArgStringList
&CmdArgs) const override;<br>
+ void AddLinkRuntimeLib(const llvm::opt::ArgList
&Args,<br>
+ llvm::opt::ArgStringList
&CmdArgs) const;<br>
+};<br>
+<br>
+} // namespace toolchains<br>
+<br>
+namespace tools {<br>
+namespace baremetal {<br>
+<br>
+class LLVM_LIBRARY_VISIBILITY Linker : public Tool {<br>
+public:<br>
+ Linker(const ToolChain &TC) :
Tool("baremetal::Linker", "ld.lld", TC) {}<br>
+ bool isLinkJob() const override { return true; }<br>
+ bool hasIntegratedCPP() const override { return false;
}<br>
+ void ConstructJob(Compilation &C, const JobAction
&JA,<br>
+ const InputInfo &Output, const
InputInfoList &Inputs,<br>
+ const llvm::opt::ArgList &TCArgs,<br>
+ const char *LinkingOutput) const
override;<br>
+};<br>
+<br>
+} // namespace baremetal<br>
+} // namespace tools<br>
+<br>
+} // namespace driver<br>
+} // namespace clang<br>
+<br>
+#endif<br>
<br>
Modified: cfe/trunk/lib/Driver/<wbr>ToolChains/Gnu.cpp<br>
URL: <a moz-do-not-send="true"
href="http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/ToolChains/Gnu.cpp?rev=303873&r1=303872&r2=303873&view=diff"
rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-<wbr>project/cfe/trunk/lib/Driver/<wbr>ToolChains/Gnu.cpp?rev=303873&<wbr>r1=303872&r2=303873&view=diff</a><br>
==============================<wbr>==============================<wbr>==================<br>
--- cfe/trunk/lib/Driver/<wbr>ToolChains/Gnu.cpp
(original)<br>
+++ cfe/trunk/lib/Driver/<wbr>ToolChains/Gnu.cpp Thu May
25 10:42:13 2017<br>
@@ -1598,6 +1598,49 @@ bool Generic_GCC::GCCVersion::<wbr>isOlderTha<br>
return false;<br>
}<br>
<br>
+/// \brief Parse a GCCVersion object out of a string of
text.<br>
+///<br>
+/// This is the primary means of forming GCCVersion
objects.<br>
+/*static*/<br>
+Generic_GCC::GCCVersion Generic_GCC::GCCVersion::<wbr>Parse(StringRef
VersionText) {<br>
+ const GCCVersion BadVersion = {VersionText.str(), -1,
-1, -1, "", "", ""};<br>
+ std::pair<StringRef, StringRef> First =
VersionText.split('.');<br>
+ std::pair<StringRef, StringRef> Second =
First.second.split('.');<br>
+<br>
+ GCCVersion GoodVersion = {VersionText.str(), -1, -1,
-1, "", "", ""};<br>
+ if (First.first.getAsInteger(10, GoodVersion.Major) ||
GoodVersion.Major < 0)<br>
+ return BadVersion;<br>
+ GoodVersion.MajorStr = First.first.str();<br>
+ if (First.second.empty())<br>
+ return GoodVersion;<br>
+ if (Second.first.getAsInteger(10, GoodVersion.Minor) ||
GoodVersion.Minor < 0)<br>
+ return BadVersion;<br>
+ GoodVersion.MinorStr = Second.first.str();<br>
+<br>
+ // First look for a number prefix and parse that if
present. Otherwise just<br>
+ // stash the entire patch string in the suffix, and
leave the number<br>
+ // unspecified. This covers versions strings such as:<br>
+ // 5 (handled above)<br>
+ // 4.4<br>
+ // 4.4.0<br>
+ // 4.4.x<br>
+ // 4.4.2-rc4<br>
+ // 4.4.x-patched<br>
+ // And retains any patch number it finds.<br>
+ StringRef PatchText = GoodVersion.PatchSuffix =
Second.second.str();<br>
+ if (!PatchText.empty()) {<br>
+ if (size_t EndNumber = PatchText.find_first_not_of("<wbr>0123456789"))
{<br>
+ // Try to parse the number and any suffix.<br>
+ if (PatchText.slice(0, EndNumber).getAsInteger(10,
GoodVersion.Patch) ||<br>
+ GoodVersion.Patch < 0)<br>
+ return BadVersion;<br>
+ GoodVersion.PatchSuffix =
PatchText.substr(EndNumber);<br>
+ }<br>
+ }<br>
+<br>
+ return GoodVersion;<br>
+}<br>
+<br>
static llvm::StringRef getGCCToolchainDir(const ArgList
&Args) {<br>
const Arg *A = Args.getLastArg(clang::driver:<wbr>:options::OPT_gcc_toolchain);<br>
if (A)<br>
<br>
Modified: cfe/trunk/lib/Driver/<wbr>ToolChains/Linux.cpp<br>
URL: <a moz-do-not-send="true"
href="http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/ToolChains/Linux.cpp?rev=303873&r1=303872&r2=303873&view=diff"
rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-<wbr>project/cfe/trunk/lib/Driver/<wbr>ToolChains/Linux.cpp?rev=<wbr>303873&r1=303872&r2=303873&<wbr>view=diff</a><br>
==============================<wbr>==============================<wbr>==================<br>
--- cfe/trunk/lib/Driver/<wbr>ToolChains/Linux.cpp
(original)<br>
+++ cfe/trunk/lib/Driver/<wbr>ToolChains/Linux.cpp Thu May
25 10:42:13 2017<br>
@@ -372,49 +372,6 @@ Linux::Linux(const Driver &D,
const llvm<br>
addPathIfExists(D, SysRoot + "/usr/lib", Paths);<br>
}<br>
<br>
-/// \brief Parse a GCCVersion object out of a string of
text.<br>
-///<br>
-/// This is the primary means of forming GCCVersion
objects.<br>
-/*static*/<br>
-Generic_GCC::GCCVersion Linux::GCCVersion::Parse(<wbr>StringRef
VersionText) {<br>
- const GCCVersion BadVersion = {VersionText.str(), -1,
-1, -1, "", "", ""};<br>
- std::pair<StringRef, StringRef> First =
VersionText.split('.');<br>
- std::pair<StringRef, StringRef> Second =
First.second.split('.');<br>
-<br>
- GCCVersion GoodVersion = {VersionText.str(), -1, -1,
-1, "", "", ""};<br>
- if (First.first.getAsInteger(10, GoodVersion.Major) ||
GoodVersion.Major < 0)<br>
- return BadVersion;<br>
- GoodVersion.MajorStr = First.first.str();<br>
- if (First.second.empty())<br>
- return GoodVersion;<br>
- if (Second.first.getAsInteger(10, GoodVersion.Minor) ||
GoodVersion.Minor < 0)<br>
- return BadVersion;<br>
- GoodVersion.MinorStr = Second.first.str();<br>
-<br>
- // First look for a number prefix and parse that if
present. Otherwise just<br>
- // stash the entire patch string in the suffix, and
leave the number<br>
- // unspecified. This covers versions strings such as:<br>
- // 5 (handled above)<br>
- // 4.4<br>
- // 4.4.0<br>
- // 4.4.x<br>
- // 4.4.2-rc4<br>
- // 4.4.x-patched<br>
- // And retains any patch number it finds.<br>
- StringRef PatchText = GoodVersion.PatchSuffix =
Second.second.str();<br>
- if (!PatchText.empty()) {<br>
- if (size_t EndNumber = PatchText.find_first_not_of("<wbr>0123456789"))
{<br>
- // Try to parse the number and any suffix.<br>
- if (PatchText.slice(0, EndNumber).getAsInteger(10,
GoodVersion.Patch) ||<br>
- GoodVersion.Patch < 0)<br>
- return BadVersion;<br>
- GoodVersion.PatchSuffix =
PatchText.substr(EndNumber);<br>
- }<br>
- }<br>
-<br>
- return GoodVersion;<br>
-}<br>
-<br>
bool Linux::HasNativeLLVMSupport() const { return true; }<br>
<br>
Tool *Linux::buildLinker() const { return new
tools::gnutools::Linker(*this)<wbr>; }<br>
<br>
Added: cfe/trunk/test/Driver/Inputs/<wbr>baremetal_arm/include/c++/5.0.<wbr>0/.keep<br>
URL: <a moz-do-not-send="true"
href="http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/Inputs/baremetal_arm/include/c%2B%2B/5.0.0/.keep?rev=303873&view=auto"
rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-<wbr>project/cfe/trunk/test/Driver/<wbr>Inputs/baremetal_arm/include/<wbr>c%2B%2B/5.0.0/.keep?rev=<wbr>303873&view=auto</a><br>
==============================<wbr>==============================<wbr>==================<br>
(empty)<br>
<br>
Added: cfe/trunk/test/Driver/Inputs/<wbr>baremetal_arm/include/c++/6.0.<wbr>0/.keep<br>
URL: <a moz-do-not-send="true"
href="http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/Inputs/baremetal_arm/include/c%2B%2B/6.0.0/.keep?rev=303873&view=auto"
rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-<wbr>project/cfe/trunk/test/Driver/<wbr>Inputs/baremetal_arm/include/<wbr>c%2B%2B/6.0.0/.keep?rev=<wbr>303873&view=auto</a><br>
==============================<wbr>==============================<wbr>==================<br>
(empty)<br>
<br>
Added: cfe/trunk/test/Driver/Inputs/<wbr>baremetal_arm/include/c++/v1/.<wbr>keep<br>
URL: <a moz-do-not-send="true"
href="http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/Inputs/baremetal_arm/include/c%2B%2B/v1/.keep?rev=303873&view=auto"
rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-<wbr>project/cfe/trunk/test/Driver/<wbr>Inputs/baremetal_arm/include/<wbr>c%2B%2B/v1/.keep?rev=303873&<wbr>view=auto</a><br>
==============================<wbr>==============================<wbr>==================<br>
(empty)<br>
<br>
Added: cfe/trunk/test/Driver/<wbr>baremetal.cpp<br>
URL: <a moz-do-not-send="true"
href="http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/baremetal.cpp?rev=303873&view=auto"
rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-<wbr>project/cfe/trunk/test/Driver/<wbr>baremetal.cpp?rev=303873&view=<wbr>auto</a><br>
==============================<wbr>==============================<wbr>==================<br>
--- cfe/trunk/test/Driver/<wbr>baremetal.cpp (added)<br>
+++ cfe/trunk/test/Driver/<wbr>baremetal.cpp Thu May 25
10:42:13 2017<br>
@@ -0,0 +1,77 @@<br>
+// RUN: %clang -no-canonical-prefixes %s -### -o %t.o
2>&1 \<br>
+// RUN: -target armv6m-none-eabi \<br>
+// RUN: -T semihosted.lds \<br>
+// RUN: -L some/directory/user/asked/for \<br>
+// RUN: --sysroot=%S/Inputs/baremetal_<wbr>arm \<br>
+// RUN: | FileCheck --check-prefix=CHECK-V6M-C %s<br>
+// CHECK-V6M-C: "[[PREFIX_DIR:.*]]/bin/clang" "-cc1"
"-triple" "thumbv6m-none--eabi"<br>
+// CHECK-V6M-C-SAME: "-resource-dir"
"[[PREFIX_DIR]]/lib/clang/[[<wbr>VERSION:[^"]*]]"<br>
+// CHECK-V6M-C-SAME: "-isysroot" "[[SYSROOT:[^"]*]]"<br>
+// CHECK-V6M-C-SAME: "-internal-isystem"
"[[SYSROOT]]/include/c++/v1"<br>
+// CHECk-V6M-C-SAME: "-internal-isystem"
"[[SYSROOT]]/include"<br>
+// CHECK-V6M-C-SAME: "-x" "c++" "{{.*}}baremetal.cpp"<br>
+// CHECK-V6M-C-NEXT: "[[PREFIX_DIR:.*]]/bin/ld.lld"
"{{.*}}.o" "-Bstatic"<br>
+// CHECK-V6M-C-SAME: "-L[[PREFIX_DIR]]/lib/clang/[[<wbr>VERSION]]/lib/baremetal"<br>
+// CHECK-V6M-C-SAME: "-T" "semihosted.lds"
"-Lsome/directory/user/asked/<wbr>for"<br>
+// CHECK-V6M-C-SAME: "-lc" "-lm"
"-lclang_rt.builtins-armv6m.a"<br>
+// CHECK-V6M-C-SAME: "-o" "{{.*}}.o"<br>
+<br>
+// RUN: %clang -no-canonical-prefixes %s -### -o %t.o
2>&1 \<br>
+// RUN: -target armv6m-none-eabi \<br>
+// RUN: -nostdlibinc -nobuiltininc \<br>
+// RUN: --sysroot=%S/Inputs/baremetal_<wbr>arm \<br>
+// RUN: | FileCheck --check-prefix=CHECK-V6M-<wbr>LIBINC
%s<br>
+// RUN: %clang -no-canonical-prefixes %s -### -o %t.o
2>&1 \<br>
+// RUN: -target armv6m-none-eabi \<br>
+// RUN: -nostdinc \<br>
+// RUN: --sysroot=%S/Inputs/baremetal_<wbr>arm \<br>
+// RUN: | FileCheck --check-prefix=CHECK-V6M-<wbr>LIBINC
%s<br>
+// CHECK-V6M-LIBINC-NOT: "-internal-isystem"<br>
+<br>
+// RUN: %clangxx -no-canonical-prefixes %s -### -o %t.o
2>&1 \<br>
+// RUN: -target armv6m-none-eabi \<br>
+// RUN: --sysroot=%S/Inputs/baremetal_<wbr>arm \<br>
+// RUN: | FileCheck --check-prefix=CHECK-V6M-<wbr>DEFAULTCXX
%s<br>
+// CHECK-V6M-DEFAULTCXX: "[[PREFIX_DIR:.*]]/bin/ld.lld"
"{{.*}}.o" "-Bstatic"<br>
+// CHECK-V6M-DEFAULTCXX-SAME:
"-L[[PREFIX_DIR]]/lib/clang/{{<wbr>.*}}/lib/baremetal"<br>
+// CHECK-V6M-DEFAULTCXX-SAME: "-lc++" "-lc++abi"
"-lunwind"<br>
+// CHECK-V6M-DEFAULTCXX-SAME: "-lc" "-lm"
"-lclang_rt.builtins-armv6m.a"<br>
+// CHECK-V6M-DEFAULTCXX-SAME: "-o" "{{.*}}.o"<br>
+<br>
+// RUN: %clangxx -no-canonical-prefixes %s -### -o %t.o
2>&1 \<br>
+// RUN: -target armv6m-none-eabi \<br>
+// RUN: --sysroot=%S/Inputs/baremetal_<wbr>arm \<br>
+// RUN: -stdlib=libc++ \<br>
+// RUN: | FileCheck --check-prefix=CHECK-V6M-<wbr>LIBCXX
%s<br>
+// CHECK-V6M-LIBCXX-NOT: "-internal-isystem"
"{{[^"]+}}/include/c++/{{[^v].<wbr>*}}"<br>
+// CHECK-V6M-LIBCXX: "-internal-isystem"
"{{[^"]+}}/include/c++/v1"<br>
+// CHECK-V6M-LIBCXX: "[[PREFIX_DIR:.*]]/bin/ld.lld"
"{{.*}}.o" "-Bstatic"<br>
+// CHECK-V6M-LIBCXX-SAME: "-L[[PREFIX_DIR]]/lib/clang/{{<wbr>.*}}/lib/baremetal"<br>
+// CHECK-V6M-LIBCXX-SAME: "-lc++" "-lc++abi" "-lunwind"<br>
+// CHECK-V6M-LIBCXX-SAME: "-lc" "-lm"
"-lclang_rt.builtins-armv6m.a"<br>
+// CHECK-V6M-LIBCXX-SAME: "-o" "{{.*}}.o"<br>
+<br>
+// RUN: %clangxx -no-canonical-prefixes %s -### -o %t.o
2>&1 \<br>
+// RUN: -target armv6m-none-eabi \<br>
+// RUN: --sysroot=%S/Inputs/baremetal_<wbr>arm \<br>
+// RUN: -stdlib=libstdc++ \<br>
+// RUN: | FileCheck --check-prefix=CHECK-V6M-<wbr>LIBSTDCXX
%s<br>
+// CHECK-V6M-LIBSTDCXX-NOT: "-internal-isystem"
"{{[^"]+}}/include/c++/v1"<br>
+// CHECK-V6M-LIBSTDCXX: "-internal-isystem"
"{{[^"]+}}/include/c++/6.0.0"<br>
+// CHECK-V6M-LIBSTDCXX: "[[PREFIX_DIR:.*]]/bin/ld.lld"
"{{.*}}.o" "-Bstatic"<br>
+// CHECK-V6M-LIBSTDCXX-SAME:
"-L[[PREFIX_DIR]]/lib/clang/{{<wbr>.*}}/lib/baremetal"<br>
+// CHECK-V6M-LIBSTDCXX-SAME: "-lstdc++" "-lsupc++"
"-lunwind"<br>
+// CHECK-V6M-LIBSTDCXX-SAME: "-lc" "-lm"
"-lclang_rt.builtins-armv6m.a"<br>
+// CHECK-V6M-LIBSTDCXX-SAME: "-o" "{{.*}}.o"<br>
+<br>
+// RUN: %clangxx -no-canonical-prefixes %s -### -o %t.o
2>&1 \<br>
+// RUN: -target armv6m-none-eabi \<br>
+// RUN: --sysroot=%S/Inputs/baremetal_<wbr>arm \<br>
+// RUN: -nodefaultlibs \<br>
+// RUN: | FileCheck --check-prefix=CHECK-V6M-NDL %s<br>
+// CHECK-V6M-NDL: "[[PREFIX_DIR:.*]]/bin/ld.lld"
"{{.*}}.o" "-Bstatic"<br>
+// CHECK-V6M-NDL-SAME: "-L[[PREFIX_DIR]]/lib/clang/{{<wbr>.*}}/lib/baremetal"
"-o" "{{.*}}.o"<br>
+<br>
+// RUN: %clangxx -target arm-none-eabi -v 2>&1 \<br>
+// RUN: | FileCheck %s --check-prefix=CHECK-THREAD-<wbr>MODEL<br>
+// CHECK-THREAD-MODEL: Thread model: single<br>
<br>
Modified: cfe/trunk/test/Frontend/gnu-<wbr>mcount.c<br>
URL: <a moz-do-not-send="true"
href="http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Frontend/gnu-mcount.c?rev=303873&r1=303872&r2=303873&view=diff"
rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-<wbr>project/cfe/trunk/test/<wbr>Frontend/gnu-mcount.c?rev=<wbr>303873&r1=303872&r2=303873&<wbr>view=diff</a><br>
==============================<wbr>==============================<wbr>==================<br>
--- cfe/trunk/test/Frontend/gnu-<wbr>mcount.c (original)<br>
+++ cfe/trunk/test/Frontend/gnu-<wbr>mcount.c Thu May 25
10:42:13 2017<br>
@@ -1,9 +1,9 @@<br>
// REQUIRES: arm-registered-target,aarch64-<wbr>registered-target<br>
<br>
-// RUN: %clang -target armv7-unknown-none-eabi -pg -S
-emit-llvm -o - %s | FileCheck %s -check-prefix CHECK
-check-prefix CHECK-ARM-EABI<br>
-// RUN: %clang -target armv7-unknown-none-eabi -pg -meabi
gnu -S -emit-llvm -o - %s | FileCheck %s -check-prefix
CHECK -check-prefix CHECK-ARM-EABI-MEABI-GNU<br>
-// RUN: %clang -target aarch64-unknown-none-eabi -pg -S
-emit-llvm -o - %s | FileCheck %s -check-prefix CHECK
-check-prefix CHECK-ARM64-EABI<br>
-// RUN: %clang -target aarch64-unknown-none-eabi -pg
-meabi gnu -S -emit-llvm -o - %s | FileCheck %s
-check-prefix CHECK -check-prefix
CHECK-ARM64-EABI-MEABI-GNU<br>
+// RUN: %clang -target armv7-unknown-none-eabi -pg -S
-emit-llvm -o - %s | FileCheck %s -check-prefix CHECK
-check-prefix CHECK-ARM-BAREMETAL-EABI<br>
+// RUN: %clang -target armv7-unknown-none-eabi -pg -meabi
gnu -S -emit-llvm -o - %s | FileCheck %s -check-prefix
CHECK -check-prefix CHECK-ARM-BAREMETAL-EABI-<wbr>MEABI-GNU<br>
+// RUN: %clang -target aarch64-unknown-none-eabi -pg -S
-emit-llvm -o - %s | FileCheck %s -check-prefix CHECK
-check-prefix CHECK-ARM64-BAREMETAL-EABI<br>
+// RUN: %clang -target aarch64-unknown-none-eabi -pg
-meabi gnu -S -emit-llvm -o - %s | FileCheck %s
-check-prefix CHECK -check-prefix
CHECK-ARM64-BAREMETAL-EABI-<wbr>MEABI-GNU<br>
// RUN: %clang -target armv7-unknown-linux-gnueabi -pg -S
-emit-llvm -o - %s | FileCheck %s -check-prefix CHECK
-check-prefix CHECK-ARM-EABI<br>
// RUN: %clang -target armv7-unknown-linux-gnueabi -meabi
gnu -pg -S -emit-llvm -o - %s | FileCheck %s -check-prefix
CHECK -check-prefix CHECK-ARM-EABI-MEABI-GNU<br>
// RUN: %clang -target aarch64-unknown-linux-gnueabi -pg
-S -emit-llvm -o - %s | FileCheck %s -check-prefix CHECK
-check-prefix CHECK-ARM64-EABI-LINUX<br>
@@ -46,6 +46,11 @@ int f() {<br>
}<br>
<br>
// CHECK-LABEL: f<br>
+// TODO: add profiling support for arm-baremetal<br>
+// CHECK-ARM-BAREMETAL-EABI-NOT: attributes #{{[0-9]+}} =
{ {{.*}}"counting-function"="\<wbr>01mcount"{{.*}} }<br>
+// CHECK-ARM-BAREMETAL-EABI-NOT: attributes #{{[0-9]+}} =
{ {{.*}}"counting-function"="\<wbr>01__gnu_mcount_nc"{{.*}}
}<br>
+// CHECK-ARM64-BAREMETAL-EABI: attributes #{{[0-9]+}} = {
{{.*}}"counting-function"="<wbr>mcount"{{.*}} }<br>
+// CHECK-ARM64-BAREMETAL-EABI-<wbr>MEABI-GNU: attributes
#{{[0-9]+}} = { {{.*}}"counting-function"="\<wbr>01_mcount"{{.*}}
}<br>
// CHECK-ARM-IOS-NOT: attributes #{{[0-9]+}} = {
{{.*}}"counting-function"="_<wbr>mcount"{{.*}} }<br>
// CHECK-ARM-IOS-NOT: attributes #{{[0-9]+}} = {
{{.*}}"counting-function"="\<wbr>01__gnu_mcount_nc"{{.*}}
}<br>
// CHECK-ARM-EABI: attributes #{{[0-9]+}} = {
{{.*}}"counting-function"="\<wbr>01mcount"{{.*}} }<br>
<br>
<br>
______________________________<wbr>_________________<br>
cfe-commits mailing list<br>
<a moz-do-not-send="true"
href="mailto:cfe-commits@lists.llvm.org">cfe-commits@lists.llvm.org</a><br>
<a moz-do-not-send="true"
href="http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits"
rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/<wbr>mailman/listinfo/cfe-commits</a><br>
</blockquote>
</div>
<br>
</div>
</div>
</blockquote>
<br>
<pre class="moz-signature" cols="72">--
Jon Roelofs
<a class="moz-txt-link-abbreviated" href="mailto:jonathan@codesourcery.com">jonathan@codesourcery.com</a>
CodeSourcery / Mentor Embedded / Siemens</pre>
</body>
</html>