<div dir="ltr">It's two weeks later and I'm still seeing this warning. Any news?</div><br><div class="gmail_quote"><div dir="ltr">On Fri, Aug 3, 2018 at 9:29 AM Dávid Bolvanský <<a href="mailto:david.bolvansky@gmail.com">david.bolvansky@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Such filename fix could be part of <a href="https://reviews.llvm.org/D50246" target="_blank">https://reviews.llvm.org/D50246</a><br></div><br><div class="gmail_quote"><div dir="ltr">pi 3. 8. 2018 o 15:17 Nico Weber <<a href="mailto:thakis@chromium.org" target="_blank">thakis@chromium.org</a>> napísal(a):<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">I'm getting this warning from the mac linker after this commit:<div><br></div><div><div>/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool: warning same member name (libclangDriver.RISCV.o) in output file used for input files: obj/clang/lib/Driver/ToolChains/Arch/libclangDriver.RISCV.o and: obj/clang/lib/Driver/ToolChains/libclangDriver.RISCV.o (due to use of basename, truncation, blank padding or duplicate input files)</div></div><div><br></div><div>Could we rename the file to fix that warning?</div></div><br><div class="gmail_quote"><div dir="ltr">On Tue, Jul 31, 2018 at 10:40 AM David Bolvansky via cfe-commits <<a href="mailto:cfe-commits@lists.llvm.org" target="_blank">cfe-commits@lists.llvm.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Author: xbolva00<br>
Date: Tue Jul 31 07:21:46 2018<br>
New Revision: 338385<br>
<br>
URL: <a href="http://llvm.org/viewvc/llvm-project?rev=338385&view=rev" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project?rev=338385&view=rev</a><br>
Log:<br>
[RISCV] Add driver for riscv32-unknown-elf baremetal target<br>
<br>
Summary:<br>
This patch adds a driver for the baremetal RISC-V target (i.e. riscv32-unknown-elf). For reference, D39963 added basic target info and added support for riscv32-linux-unknown-elf.<br>
<br>
Patch by: asb (Alex Bradbury)<br>
<br>
Reviewers: efriedma, phosek, apazos, espindola, mgrang<br>
<br>
Reviewed By: mgrang<br>
<br>
Subscribers: jrtc27, rogfer01, MartinMosbeck, brucehoult, the_o, rkruppe, emaste, mgorny, arichardson, rbar, johnrusso, simoncook, jordy.potman.lists, sabuasal, niosHD, kito-cheng, shiva0217, zzheng, edward-jones, mgrang, cfe-commits<br>
<br>
Differential Revision: <a href="https://reviews.llvm.org/D46822" rel="noreferrer" target="_blank">https://reviews.llvm.org/D46822</a><br>
<br>
Added:<br>
    cfe/trunk/lib/Driver/ToolChains/RISCV.cpp<br>
    cfe/trunk/lib/Driver/ToolChains/RISCV.h<br>
    cfe/trunk/test/Driver/Inputs/basic_riscv32_tree/<br>
    cfe/trunk/test/Driver/Inputs/basic_riscv32_tree/bin/<br>
    cfe/trunk/test/Driver/Inputs/basic_riscv32_tree/bin/riscv32-unknown-elf-ld   (with props)<br>
    cfe/trunk/test/Driver/Inputs/basic_riscv32_tree/lib/<br>
    cfe/trunk/test/Driver/Inputs/basic_riscv32_tree/lib/gcc/<br>
    cfe/trunk/test/Driver/Inputs/basic_riscv32_tree/lib/gcc/riscv32-unknown-elf/<br>
    cfe/trunk/test/Driver/Inputs/basic_riscv32_tree/lib/gcc/riscv32-unknown-elf/8.0.1/<br>
    cfe/trunk/test/Driver/Inputs/basic_riscv32_tree/lib/gcc/riscv32-unknown-elf/8.0.1/crtbegin.o<br>
    cfe/trunk/test/Driver/Inputs/basic_riscv32_tree/lib/gcc/riscv32-unknown-elf/8.0.1/crtend.o<br>
    cfe/trunk/test/Driver/Inputs/basic_riscv32_tree/riscv32-unknown-elf/<br>
    cfe/trunk/test/Driver/Inputs/basic_riscv32_tree/riscv32-unknown-elf/include/<br>
    cfe/trunk/test/Driver/Inputs/basic_riscv32_tree/riscv32-unknown-elf/include/c++/<br>
    cfe/trunk/test/Driver/Inputs/basic_riscv32_tree/riscv32-unknown-elf/include/c++/8.0.1/<br>
    cfe/trunk/test/Driver/Inputs/basic_riscv32_tree/riscv32-unknown-elf/include/c++/8.0.1/.keep<br>
    cfe/trunk/test/Driver/Inputs/basic_riscv32_tree/riscv32-unknown-elf/lib/<br>
    cfe/trunk/test/Driver/Inputs/basic_riscv32_tree/riscv32-unknown-elf/lib/crt0.o<br>
Modified:<br>
    cfe/trunk/lib/Driver/CMakeLists.txt<br>
    cfe/trunk/lib/Driver/Driver.cpp<br>
    cfe/trunk/lib/Driver/ToolChains/Gnu.cpp<br>
    cfe/trunk/test/Driver/riscv32-toolchain.c<br>
<br>
Modified: cfe/trunk/lib/Driver/CMakeLists.txt<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/CMakeLists.txt?rev=338385&r1=338384&r2=338385&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/CMakeLists.txt?rev=338385&r1=338384&r2=338385&view=diff</a><br>
==============================================================================<br>
--- cfe/trunk/lib/Driver/CMakeLists.txt (original)<br>
+++ cfe/trunk/lib/Driver/CMakeLists.txt Tue Jul 31 07:21:46 2018<br>
@@ -57,6 +57,7 @@ add_clang_library(clangDriver<br>
   ToolChains/NetBSD.cpp<br>
   ToolChains/OpenBSD.cpp<br>
   ToolChains/PS4CPU.cpp<br>
+  ToolChains/RISCV.cpp<br>
   ToolChains/Solaris.cpp<br>
   ToolChains/TCE.cpp<br>
   ToolChains/WebAssembly.cpp<br>
<br>
Modified: cfe/trunk/lib/Driver/Driver.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/Driver.cpp?rev=338385&r1=338384&r2=338385&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/Driver.cpp?rev=338385&r1=338384&r2=338385&view=diff</a><br>
==============================================================================<br>
--- cfe/trunk/lib/Driver/Driver.cpp (original)<br>
+++ cfe/trunk/lib/Driver/Driver.cpp Tue Jul 31 07:21:46 2018<br>
@@ -37,6 +37,7 @@<br>
 #include "ToolChains/NetBSD.h"<br>
 #include "ToolChains/OpenBSD.h"<br>
 #include "ToolChains/PS4CPU.h"<br>
+#include "ToolChains/RISCV.h"<br>
 #include "ToolChains/Solaris.h"<br>
 #include "ToolChains/TCE.h"<br>
 #include "ToolChains/WebAssembly.h"<br>
@@ -4399,6 +4400,10 @@ const ToolChain &Driver::getToolChain(co<br>
       case llvm::Triple::avr:<br>
         TC = llvm::make_unique<toolchains::AVRToolChain>(*this, Target, Args);<br>
         break;<br>
+      case llvm::Triple::riscv32:<br>
+      case llvm::Triple::riscv64:<br>
+        TC = llvm::make_unique<toolchains::RISCVToolChain>(*this, Target, Args);<br>
+        break;<br>
       default:<br>
         if (Target.getVendor() == llvm::Triple::Myriad)<br>
           TC = llvm::make_unique<toolchains::MyriadToolChain>(*this, Target,<br>
<br>
Modified: cfe/trunk/lib/Driver/ToolChains/Gnu.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/ToolChains/Gnu.cpp?rev=338385&r1=338384&r2=338385&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/ToolChains/Gnu.cpp?rev=338385&r1=338384&r2=338385&view=diff</a><br>
==============================================================================<br>
--- cfe/trunk/lib/Driver/ToolChains/Gnu.cpp (original)<br>
+++ cfe/trunk/lib/Driver/ToolChains/Gnu.cpp Tue Jul 31 07:21:46 2018<br>
@@ -1877,7 +1877,8 @@ void Generic_GCC::GCCInstallationDetecto<br>
<br>
   static const char *const RISCV32LibDirs[] = {"/lib", "/lib32"};<br>
   static const char *const RISCVTriples[] = {"riscv32-unknown-linux-gnu",<br>
-                                             "riscv64-unknown-linux-gnu"};<br>
+                                             "riscv64-unknown-linux-gnu",<br>
+                                             "riscv32-unknown-elf"};<br>
<br>
   static const char *const SPARCv8LibDirs[] = {"/lib32", "/lib"};<br>
   static const char *const SPARCv8Triples[] = {"sparc-linux-gnu",<br>
<br>
Added: cfe/trunk/lib/Driver/ToolChains/RISCV.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/ToolChains/RISCV.cpp?rev=338385&view=auto" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/ToolChains/RISCV.cpp?rev=338385&view=auto</a><br>
==============================================================================<br>
--- cfe/trunk/lib/Driver/ToolChains/RISCV.cpp (added)<br>
+++ cfe/trunk/lib/Driver/ToolChains/RISCV.cpp Tue Jul 31 07:21:46 2018<br>
@@ -0,0 +1,117 @@<br>
+//===--- RISCV.cpp - RISCV ToolChain Implementations ------------*- 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>
+//===----------------------------------------------------------------------===//<br>
+<br>
+#include "RISCV.h"<br>
+#include "CommonArgs.h"<br>
+#include "InputInfo.h"<br>
+#include "clang/Driver/Compilation.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 clang::driver;<br>
+using namespace clang::driver::toolchains;<br>
+using namespace clang::driver::tools;<br>
+using namespace clang;<br>
+using namespace llvm::opt;<br>
+<br>
+/// RISCV Toolchain<br>
+RISCVToolChain::RISCVToolChain(const Driver &D, const llvm::Triple &Triple,<br>
+                               const ArgList &Args)<br>
+    : Generic_ELF(D, Triple, Args) {<br>
+  GCCInstallation.init(Triple, Args);<br>
+  getFilePaths().push_back(D.SysRoot + "/lib");<br>
+  if (GCCInstallation.isValid()) {<br>
+    getFilePaths().push_back(GCCInstallation.getInstallPath().str());<br>
+    getProgramPaths().push_back(<br>
+        (GCCInstallation.getParentLibPath() + "/../bin").str());<br>
+  }<br>
+}<br>
+<br>
+Tool *RISCVToolChain::buildLinker() const {<br>
+  return new tools::RISCV::Linker(*this);<br>
+}<br>
+<br>
+void RISCVToolChain::AddClangSystemIncludeArgs(const ArgList &DriverArgs,<br>
+                                               ArgStringList &CC1Args) const {<br>
+  if (DriverArgs.hasArg(options::OPT_nostdinc))<br>
+    return;<br>
+<br>
+  if (!DriverArgs.hasArg(options::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 RISCVToolChain::addLibStdCxxIncludePaths(<br>
+    const llvm::opt::ArgList &DriverArgs,<br>
+    llvm::opt::ArgStringList &CC1Args) const {<br>
+  StringRef LibDir = GCCInstallation.getParentLibPath();<br>
+  const GCCVersion &Version = GCCInstallation.getVersion();<br>
+  StringRef TripleStr = GCCInstallation.getTriple().str();<br>
+  const Multilib &Multilib = GCCInstallation.getMultilib();<br>
+  addLibStdCXXIncludePaths(<br>
+      LibDir.str() + "/../" + TripleStr.str() + "/include/c++/" + Version.Text,<br>
+      "", TripleStr, "", "", Multilib.includeSuffix(), DriverArgs, CC1Args);<br>
+}<br>
+<br>
+void RISCV::Linker::ConstructJob(Compilation &C, const JobAction &JA,<br>
+                                 const InputInfo &Output,<br>
+                                 const InputInfoList &Inputs,<br>
+                                 const ArgList &Args,<br>
+                                 const char *LinkingOutput) const {<br>
+  const ToolChain &ToolChain = getToolChain();<br>
+  const Driver &D = ToolChain.getDriver();<br>
+  ArgStringList CmdArgs;<br>
+<br>
+  if (!D.SysRoot.empty())<br>
+    CmdArgs.push_back(Args.MakeArgString("--sysroot=" + D.SysRoot));<br>
+<br>
+  std::string Linker = getToolChain().GetProgramPath(getShortName());<br>
+<br>
+  bool WantCRTs =<br>
+      !Args.hasArg(options::OPT_nostdlib, options::OPT_nostartfiles);<br>
+<br>
+  if (WantCRTs) {<br>
+    CmdArgs.push_back(Args.MakeArgString(ToolChain.GetFilePath("crt0.o")));<br>
+    CmdArgs.push_back(Args.MakeArgString(ToolChain.GetFilePath("crtbegin.o")));<br>
+  }<br>
+<br>
+  Args.AddAllArgs(CmdArgs, options::OPT_L);<br>
+  ToolChain.AddFilePathLibArgs(Args, CmdArgs);<br>
+  Args.AddAllArgs(CmdArgs,<br>
+                  {options::OPT_T_Group, options::OPT_e, options::OPT_s,<br>
+                   options::OPT_t, options::OPT_Z_Flag, options::OPT_r});<br>
+<br>
+  AddLinkerInputs(ToolChain, Inputs, Args, CmdArgs, JA);<br>
+<br>
+  // TODO: add C++ includes and libs if compiling C++.<br>
+<br>
+  if (!Args.hasArg(options::OPT_nostdlib) &&<br>
+      !Args.hasArg(options::OPT_nodefaultlibs)) {<br>
+    if (ToolChain.ShouldLinkCXXStdlib(Args))<br>
+      ToolChain.AddCXXStdlibLibArgs(Args, CmdArgs);<br>
+    CmdArgs.push_back("--start-group");<br>
+    CmdArgs.push_back("-lc");<br>
+    CmdArgs.push_back("-lgloss");<br>
+    CmdArgs.push_back("--end-group");<br>
+    CmdArgs.push_back("-lgcc");<br>
+  }<br>
+<br>
+  if (WantCRTs)<br>
+    CmdArgs.push_back(Args.MakeArgString(ToolChain.GetFilePath("crtend.o")));<br>
+<br>
+  CmdArgs.push_back("-o");<br>
+  CmdArgs.push_back(Output.getFilename());<br>
+  C.addCommand(llvm::make_unique<Command>(JA, *this, Args.MakeArgString(Linker),<br>
+                                          CmdArgs, Inputs));<br>
+}<br>
+// RISCV tools end.<br>
<br>
Added: cfe/trunk/lib/Driver/ToolChains/RISCV.h<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/ToolChains/RISCV.h?rev=338385&view=auto" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/ToolChains/RISCV.h?rev=338385&view=auto</a><br>
==============================================================================<br>
--- cfe/trunk/lib/Driver/ToolChains/RISCV.h (added)<br>
+++ cfe/trunk/lib/Driver/ToolChains/RISCV.h Tue Jul 31 07:21:46 2018<br>
@@ -0,0 +1,57 @@<br>
+//===--- RISCV.h - RISCV ToolChain Implementations --------------*- 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>
+//===----------------------------------------------------------------------===//<br>
+<br>
+#ifndef LLVM_CLANG_LIB_DRIVER_TOOLCHAINS_RISCV_H<br>
+#define LLVM_CLANG_LIB_DRIVER_TOOLCHAINS_RISCV_H<br>
+<br>
+#include "Gnu.h"<br>
+#include "clang/Driver/ToolChain.h"<br>
+<br>
+namespace clang {<br>
+namespace driver {<br>
+namespace toolchains {<br>
+<br>
+class LLVM_LIBRARY_VISIBILITY RISCVToolChain : public Generic_ELF {<br>
+public:<br>
+  RISCVToolChain(const Driver &D, const llvm::Triple &Triple,<br>
+                 const llvm::opt::ArgList &Args);<br>
+<br>
+  bool IsIntegratedAssemblerDefault() const override { return true; }<br>
+  void<br>
+  AddClangSystemIncludeArgs(const llvm::opt::ArgList &DriverArgs,<br>
+                            llvm::opt::ArgStringList &CC1Args) const override;<br>
+  void<br>
+  addLibStdCxxIncludePaths(const llvm::opt::ArgList &DriverArgs,<br>
+                           llvm::opt::ArgStringList &CC1Args) const override;<br>
+<br>
+protected:<br>
+  Tool *buildLinker() const override;<br>
+};<br>
+<br>
+} // end namespace toolchains<br>
+<br>
+namespace tools {<br>
+namespace RISCV {<br>
+class LLVM_LIBRARY_VISIBILITY Linker : public GnuTool {<br>
+public:<br>
+  Linker(const ToolChain &TC) : GnuTool("RISCV::Linker", "ld", TC) {}<br>
+  bool hasIntegratedCPP() const override { return false; }<br>
+  bool isLinkJob() const override { return true; }<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>
+} // end namespace RISCV<br>
+} // end namespace tools<br>
+<br>
+} // end namespace driver<br>
+} // end namespace clang<br>
+<br>
+#endif // LLVM_CLANG_LIB_DRIVER_TOOLCHAINS_RISCV_H<br>
<br>
Added: cfe/trunk/test/Driver/Inputs/basic_riscv32_tree/bin/riscv32-unknown-elf-ld<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/Inputs/basic_riscv32_tree/bin/riscv32-unknown-elf-ld?rev=338385&view=auto" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/Inputs/basic_riscv32_tree/bin/riscv32-unknown-elf-ld?rev=338385&view=auto</a><br>
==============================================================================<br>
--- cfe/trunk/test/Driver/Inputs/basic_riscv32_tree/bin/riscv32-unknown-elf-ld (added)<br>
+++ cfe/trunk/test/Driver/Inputs/basic_riscv32_tree/bin/riscv32-unknown-elf-ld Tue Jul 31 07:21:46 2018<br>
@@ -0,0 +1 @@<br>
+#!/bin/true<br>
<br>
Propchange: cfe/trunk/test/Driver/Inputs/basic_riscv32_tree/bin/riscv32-unknown-elf-ld<br>
------------------------------------------------------------------------------<br>
    svn:executable = *<br>
<br>
Added: cfe/trunk/test/Driver/Inputs/basic_riscv32_tree/lib/gcc/riscv32-unknown-elf/8.0.1/crtbegin.o<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/Inputs/basic_riscv32_tree/lib/gcc/riscv32-unknown-elf/8.0.1/crtbegin.o?rev=338385&view=auto" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/Inputs/basic_riscv32_tree/lib/gcc/riscv32-unknown-elf/8.0.1/crtbegin.o?rev=338385&view=auto</a><br>
==============================================================================<br>
    (empty)<br>
<br>
Added: cfe/trunk/test/Driver/Inputs/basic_riscv32_tree/lib/gcc/riscv32-unknown-elf/8.0.1/crtend.o<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/Inputs/basic_riscv32_tree/lib/gcc/riscv32-unknown-elf/8.0.1/crtend.o?rev=338385&view=auto" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/Inputs/basic_riscv32_tree/lib/gcc/riscv32-unknown-elf/8.0.1/crtend.o?rev=338385&view=auto</a><br>
==============================================================================<br>
    (empty)<br>
<br>
Added: cfe/trunk/test/Driver/Inputs/basic_riscv32_tree/riscv32-unknown-elf/include/c++/8.0.1/.keep<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/Inputs/basic_riscv32_tree/riscv32-unknown-elf/include/c%2B%2B/8.0.1/.keep?rev=338385&view=auto" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/Inputs/basic_riscv32_tree/riscv32-unknown-elf/include/c%2B%2B/8.0.1/.keep?rev=338385&view=auto</a><br>
==============================================================================<br>
    (empty)<br>
<br>
Added: cfe/trunk/test/Driver/Inputs/basic_riscv32_tree/riscv32-unknown-elf/lib/crt0.o<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/Inputs/basic_riscv32_tree/riscv32-unknown-elf/lib/crt0.o?rev=338385&view=auto" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/Inputs/basic_riscv32_tree/riscv32-unknown-elf/lib/crt0.o?rev=338385&view=auto</a><br>
==============================================================================<br>
    (empty)<br>
<br>
Modified: cfe/trunk/test/Driver/riscv32-toolchain.c<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/riscv32-toolchain.c?rev=338385&r1=338384&r2=338385&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/riscv32-toolchain.c?rev=338385&r1=338384&r2=338385&view=diff</a><br>
==============================================================================<br>
--- cfe/trunk/test/Driver/riscv32-toolchain.c (original)<br>
+++ cfe/trunk/test/Driver/riscv32-toolchain.c Tue Jul 31 07:21:46 2018<br>
@@ -3,6 +3,36 @@<br>
 // RUN: %clang %s -### -no-canonical-prefixes -target riscv32 2>&1 | FileCheck -check-prefix=CC1 %s<br>
 // CC1: clang{{.*}} "-cc1" "-triple" "riscv32"<br>
<br>
+// RUN: %clang %s -### -no-canonical-prefixes \<br>
+// RUN:   -target riscv32-unknown-elf \<br>
+// RUN:   --gcc-toolchain=%S/Inputs/basic_riscv32_tree \<br>
+// RUN:   --sysroot=%S/Inputs/basic_riscv32_tree/riscv32-unknown-elf 2>&1 \<br>
+// RUN:   | FileCheck -check-prefix=C-RV32-BAREMETAL-ILP32 %s<br>
+<br>
+// C-RV32-BAREMETAL-ILP32: "{{.*}}Inputs/basic_riscv32_tree/lib/gcc/riscv32-unknown-elf/8.0.1/../../../../bin{{/|\\\\}}riscv32-unknown-elf-ld"<br>
+// C-RV32-BAREMETAL-ILP32: "--sysroot={{.*}}/Inputs/basic_riscv32_tree/riscv32-unknown-elf"<br>
+// C-RV32-BAREMETAL-ILP32: "{{.*}}/Inputs/basic_riscv32_tree/riscv32-unknown-elf/lib{{/|\\\\}}crt0.o"<br>
+// C-RV32-BAREMETAL-ILP32: "{{.*}}/Inputs/basic_riscv32_tree/lib/gcc/riscv32-unknown-elf/8.0.1{{/|\\\\}}crtbegin.o"<br>
+// C-RV32-BAREMETAL-ILP32: "-L{{.*}}/Inputs/basic_riscv32_tree/riscv32-unknown-elf/lib"<br>
+// C-RV32-BAREMETAL-ILP32: "-L{{.*}}/Inputs/basic_riscv32_tree/lib/gcc/riscv32-unknown-elf/8.0.1"<br>
+// C-RV32-BAREMETAL-ILP32: "--start-group" "-lc" "-lgloss" "--end-group" "-lgcc"<br>
+// C-RV32-BAREMETAL-ILP32: "{{.*}}/Inputs/basic_riscv32_tree/lib/gcc/riscv32-unknown-elf/8.0.1{{/|\\\\}}crtend.o"<br>
+<br>
+// RUN: %clangxx %s -### -no-canonical-prefixes \<br>
+// RUN:   -target riscv32-unknown-elf \<br>
+// RUN:   --gcc-toolchain=%S/Inputs/basic_riscv32_tree \<br>
+// RUN:   --sysroot=%S/Inputs/basic_riscv32_tree/riscv32-unknown-elf 2>&1 \<br>
+// RUN:   | FileCheck -check-prefix=CXX-RV32-BAREMETAL-ILP32 %s<br>
+<br>
+// CXX-RV32-BAREMETAL-ILP32: "-internal-isystem" "{{.*}}Inputs/basic_riscv32_tree/lib/gcc/riscv32-unknown-elf/8.0.1/../../../../riscv32-unknown-elf/include/c++{{/|\\\\}}8.0.1"<br>
+// CXX-RV32-BAREMETAL-ILP32: "{{.*}}Inputs/basic_riscv32_tree/lib/gcc/riscv32-unknown-elf/8.0.1/../../../../bin{{/|\\\\}}riscv32-unknown-elf-ld"<br>
+// CXX-RV32-BAREMETAL-ILP32: "--sysroot={{.*}}/Inputs/basic_riscv32_tree/riscv32-unknown-elf"<br>
+// CXX-RV32-BAREMETAL-ILP32: "{{.*}}/Inputs/basic_riscv32_tree/riscv32-unknown-elf/lib{{/|\\\\}}crt0.o"<br>
+// CXX-RV32-BAREMETAL-ILP32: "{{.*}}/Inputs/basic_riscv32_tree/lib/gcc/riscv32-unknown-elf/8.0.1{{/|\\\\}}crtbegin.o"<br>
+// CXX-RV32-BAREMETAL-ILP32: "-L{{.*}}/Inputs/basic_riscv32_tree/riscv32-unknown-elf/lib"<br>
+// CXX-RV32-BAREMETAL-ILP32: "-L{{.*}}/Inputs/basic_riscv32_tree/lib/gcc/riscv32-unknown-elf/8.0.1"<br>
+// CXX-RV32-BAREMETAL-ILP32: "-lstdc++" "--start-group" "-lc" "-lgloss" "--end-group" "-lgcc"<br>
+// CXX-RV32-BAREMETAL-ILP32: "{{.*}}/Inputs/basic_riscv32_tree/lib/gcc/riscv32-unknown-elf/8.0.1{{/|\\\\}}crtend.o"<br>
<br>
 // RUN: %clang %s -### -no-canonical-prefixes -fuse-ld=ld \<br>
 // RUN:   -target riscv32-linux-unknown-elf \<br>
<br>
<br>
_______________________________________________<br>
cfe-commits mailing list<br>
<a href="mailto:cfe-commits@lists.llvm.org" target="_blank">cfe-commits@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits</a><br>
</blockquote></div>
</blockquote></div>
</blockquote></div>