r255502 - [Hexagon] Update default paths and arguments

Krzysztof Parzyszek via cfe-commits cfe-commits at lists.llvm.org
Mon Dec 14 07:03:58 PST 2015


Author: kparzysz
Date: Mon Dec 14 09:03:57 2015
New Revision: 255502

URL: http://llvm.org/viewvc/llvm-project?rev=255502&view=rev
Log:
[Hexagon] Update default paths and arguments

- Removed support for hexagonv3 and earlier.
- Added handling of hexagonv55 and hexagonv60.
- Added handling of target features (hvx, hvx-double).
- Updated paths to reflect current directory layout.

Added:
    cfe/trunk/test/Driver/Inputs/hexagon_tree/Tools/
    cfe/trunk/test/Driver/Inputs/hexagon_tree/Tools/target/
    cfe/trunk/test/Driver/Inputs/hexagon_tree/Tools/target/hexagon/
    cfe/trunk/test/Driver/Inputs/hexagon_tree/Tools/target/hexagon/lib/
    cfe/trunk/test/Driver/Inputs/hexagon_tree/Tools/target/hexagon/lib/v4/
    cfe/trunk/test/Driver/Inputs/hexagon_tree/Tools/target/hexagon/lib/v4/G0/
    cfe/trunk/test/Driver/Inputs/hexagon_tree/Tools/target/hexagon/lib/v4/G0/pic/
    cfe/trunk/test/Driver/Inputs/hexagon_tree/Tools/target/hexagon/lib/v5/
    cfe/trunk/test/Driver/Inputs/hexagon_tree/Tools/target/hexagon/lib/v5/G0/
    cfe/trunk/test/Driver/Inputs/hexagon_tree/Tools/target/hexagon/lib/v5/G0/pic/
    cfe/trunk/test/Driver/Inputs/hexagon_tree/Tools/target/hexagon/lib/v55/
    cfe/trunk/test/Driver/Inputs/hexagon_tree/Tools/target/hexagon/lib/v55/G0/
    cfe/trunk/test/Driver/Inputs/hexagon_tree/Tools/target/hexagon/lib/v55/G0/pic/
    cfe/trunk/test/Driver/Inputs/hexagon_tree/Tools/target/hexagon/lib/v60/
    cfe/trunk/test/Driver/Inputs/hexagon_tree/Tools/target/hexagon/lib/v60/G0/
    cfe/trunk/test/Driver/Inputs/hexagon_tree/Tools/target/hexagon/lib/v60/G0/pic/
Removed:
    cfe/trunk/test/Driver/Inputs/hexagon_tree/gnu/
    cfe/trunk/test/Driver/Inputs/hexagon_tree/qc/
    cfe/trunk/test/Driver/hexagon-toolchain.c
Modified:
    cfe/trunk/include/clang/Driver/Options.td
    cfe/trunk/lib/Basic/Targets.cpp
    cfe/trunk/lib/Driver/ToolChains.cpp
    cfe/trunk/lib/Driver/ToolChains.h
    cfe/trunk/lib/Driver/Tools.cpp
    cfe/trunk/test/CodeGen/target-data.c
    cfe/trunk/test/Driver/hexagon-toolchain-elf.c

Modified: cfe/trunk/include/clang/Driver/Options.td
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Driver/Options.td?rev=255502&r1=255501&r2=255502&view=diff
==============================================================================
--- cfe/trunk/include/clang/Driver/Options.td (original)
+++ cfe/trunk/include/clang/Driver/Options.td Mon Dec 14 09:03:57 2015
@@ -1870,16 +1870,22 @@ def _write_user_dependencies : Flag<["--
 def _ : Joined<["--"], "">, Flags<[Unsupported]>;
 
 def mieee_rnd_near : Flag<["-"], "mieee-rnd-near">, Group<m_hexagon_Features_Group>;
-def mv1 : Flag<["-"], "mv1">, Group<m_hexagon_Features_Group>, Alias<march_EQ>,
-          AliasArgs<["v1"]>;
-def mv2 : Flag<["-"], "mv2">, Group<m_hexagon_Features_Group>, Alias<march_EQ>,
-          AliasArgs<["v2"]>;
-def mv3 : Flag<["-"], "mv3">, Group<m_hexagon_Features_Group>, Alias<march_EQ>,
-          AliasArgs<["v3"]>;
-def mv4 : Flag<["-"], "mv4">, Group<m_hexagon_Features_Group>, Alias<march_EQ>,
-          AliasArgs<["v4"]>;
-def mv5 : Flag<["-"], "mv5">, Group<m_hexagon_Features_Group>, Alias<march_EQ>,
+def mv4 : Flag<["-"], "mv4">, Group<m_hexagon_Features_Group>,
+          Alias<mcpu_EQ>, AliasArgs<["v4"]>;
+def mv5 : Flag<["-"], "mv5">, Group<m_hexagon_Features_Group>, Alias<mcpu_EQ>,
           AliasArgs<["v5"]>;
+def mv55 : Flag<["-"], "mv55">, Group<m_hexagon_Features_Group>,
+           Alias<mcpu_EQ>, AliasArgs<["v55"]>;
+def mv60 : Flag<["-"], "mv60">, Group<m_hexagon_Features_Group>,
+           Alias<mcpu_EQ>, AliasArgs<["v60"]>;
+def mhexagon_hvx : Flag<["-"], "mhvx">, Group<m_hexagon_Features_Group>,
+    Flags<[CC1Option]>, HelpText<"Enable Hexagon Vector eXtensions">;
+def mno_hexagon_hvx : Flag<["-"], "mno-hvx">, Group<m_hexagon_Features_Group>,
+    Flags<[CC1Option]>, HelpText<"Disable Hexagon Vector eXtensions">;
+def mhexagon_hvx_double : Flag<["-"], "mhvx-double">, Group<m_hexagon_Features_Group>,
+    Flags<[CC1Option]>, HelpText<"Enable Hexagon Double Vector eXtensions">;
+def mno_hexagon_hvx_double : Flag<["-"], "mno-hvx-double">, Group<m_hexagon_Features_Group>,
+    Flags<[CC1Option]>, HelpText<"Disable Hexagon Double Vector eXtensions">;
 
 // These are legacy user-facing driver-level option spellings. They are always
 // aliases for options that are spelled using the more common Unix / GNU flag

Modified: cfe/trunk/lib/Basic/Targets.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Basic/Targets.cpp?rev=255502&r1=255501&r2=255502&view=diff
==============================================================================
--- cfe/trunk/lib/Basic/Targets.cpp (original)
+++ cfe/trunk/lib/Basic/Targets.cpp Mon Dec 14 09:03:57 2015
@@ -5645,14 +5645,27 @@ class HexagonTargetInfo : public TargetI
   static const char * const GCCRegNames[];
   static const TargetInfo::GCCRegAlias GCCRegAliases[];
   std::string CPU;
+  bool HasHVX, HasHVXDouble;
+
 public:
   HexagonTargetInfo(const llvm::Triple &Triple) : TargetInfo(Triple) {
     BigEndian = false;
-    DataLayoutString = "e-m:e-p:32:32-i1:32-i64:64-a:0-n32";
+    DataLayoutString = "e-m:e-p:32:32:32-"
+                       "i64:64:64-i32:32:32-i16:16:16-i1:8:8-"
+                       "f64:64:64-f32:32:32-v64:64:64-v32:32:32-a:0-n16:32";
+    SizeType    = UnsignedInt;
+    PtrDiffType = SignedInt;
+    IntPtrType  = SignedInt;
 
     // {} in inline assembly are packet specifiers, not assembly variant
     // specifiers.
     NoAsmVariants = true;
+
+    LargeArrayMinWidth = 64;
+    LargeArrayAlign = 64;
+    UseBitFieldTypeAlignment = true;
+    ZeroLengthBitfieldBoundary = 32;
+    HasHVX = HasHVXDouble = false;
   }
 
   ArrayRef<Builtin::Info> getTargetBuiltins() const override {
@@ -5668,10 +5681,23 @@ public:
   void getTargetDefines(const LangOptions &Opts,
                         MacroBuilder &Builder) const override;
 
+  bool isCLZForZeroUndef() const override { return false; }
+
   bool hasFeature(StringRef Feature) const override {
-    return Feature == "hexagon";
+    return llvm::StringSwitch<bool>(Feature)
+      .Case("hexagon", true)
+      .Case("hvx", HasHVX)
+      .Case("hvx-double", HasHVXDouble)
+      .Default(false);
   }
 
+  bool initFeatureMap(llvm::StringMap<bool> &Features, DiagnosticsEngine &Diags,
+        StringRef CPU, const std::vector<std::string> &FeaturesVec)
+        const override;
+
+  bool handleTargetFeatures(std::vector<std::string> &Features,
+                            DiagnosticsEngine &Diags) override;
+
   BuiltinVaListKind getBuiltinVaListKind() const override {
     return TargetInfo::CharPtrBuiltinVaList;
   }
@@ -5685,71 +5711,77 @@ public:
     return llvm::StringSwitch<const char*>(Name)
       .Case("hexagonv4", "4")
       .Case("hexagonv5", "5")
+      .Case("hexagonv55", "55")
+      .Case("hexagonv60", "60")
       .Default(nullptr);
   }
 
   bool setCPU(const std::string &Name) override {
     if (!getHexagonCPUSuffix(Name))
       return false;
-
     CPU = Name;
     return true;
   }
+
+  int getEHDataRegisterNumber(unsigned RegNo) const override {
+    return RegNo < 2 ? RegNo : -1;
+  }
 };
 
 void HexagonTargetInfo::getTargetDefines(const LangOptions &Opts,
-                                MacroBuilder &Builder) const {
-  Builder.defineMacro("qdsp6");
-  Builder.defineMacro("__qdsp6", "1");
+                                         MacroBuilder &Builder) const {
   Builder.defineMacro("__qdsp6__", "1");
-
-  Builder.defineMacro("hexagon");
-  Builder.defineMacro("__hexagon", "1");
   Builder.defineMacro("__hexagon__", "1");
 
-  if(CPU == "hexagonv1") {
-    Builder.defineMacro("__HEXAGON_V1__");
-    Builder.defineMacro("__HEXAGON_ARCH__", "1");
-    if(Opts.HexagonQdsp6Compat) {
-      Builder.defineMacro("__QDSP6_V1__");
-      Builder.defineMacro("__QDSP6_ARCH__", "1");
-    }
-  }
-  else if(CPU == "hexagonv2") {
-    Builder.defineMacro("__HEXAGON_V2__");
-    Builder.defineMacro("__HEXAGON_ARCH__", "2");
-    if(Opts.HexagonQdsp6Compat) {
-      Builder.defineMacro("__QDSP6_V2__");
-      Builder.defineMacro("__QDSP6_ARCH__", "2");
-    }
-  }
-  else if(CPU == "hexagonv3") {
-    Builder.defineMacro("__HEXAGON_V3__");
-    Builder.defineMacro("__HEXAGON_ARCH__", "3");
-    if(Opts.HexagonQdsp6Compat) {
-      Builder.defineMacro("__QDSP6_V3__");
-      Builder.defineMacro("__QDSP6_ARCH__", "3");
-    }
-  }
-  else if(CPU == "hexagonv4") {
+  if (CPU == "hexagonv4") {
     Builder.defineMacro("__HEXAGON_V4__");
     Builder.defineMacro("__HEXAGON_ARCH__", "4");
-    if(Opts.HexagonQdsp6Compat) {
+    if (Opts.HexagonQdsp6Compat) {
       Builder.defineMacro("__QDSP6_V4__");
       Builder.defineMacro("__QDSP6_ARCH__", "4");
     }
-  }
-  else if(CPU == "hexagonv5") {
+  } else if (CPU == "hexagonv5") {
     Builder.defineMacro("__HEXAGON_V5__");
     Builder.defineMacro("__HEXAGON_ARCH__", "5");
     if(Opts.HexagonQdsp6Compat) {
       Builder.defineMacro("__QDSP6_V5__");
       Builder.defineMacro("__QDSP6_ARCH__", "5");
     }
+  } else if (CPU == "hexagonv60") {
+    Builder.defineMacro("__HEXAGON_V60__");
+    Builder.defineMacro("__HEXAGON_ARCH__", "60");
+    Builder.defineMacro("__QDSP6_V60__");
+    Builder.defineMacro("__QDSP6_ARCH__", "60");
+  }
+}
+
+bool HexagonTargetInfo::handleTargetFeatures(std::vector<std::string> &Features,
+                                             DiagnosticsEngine &Diags) {
+  for (auto &F : Features) {
+    if (F == "+hvx")
+      HasHVX = true;
+    else if (F == "-hvx")
+      HasHVX = HasHVXDouble = false;
+    else if (F == "+hvx-double")
+      HasHVX = HasHVXDouble = true;
+    else if (F == "-hvx-double")
+      HasHVXDouble = false;
   }
+  return true;
+}
+
+bool HexagonTargetInfo::initFeatureMap(llvm::StringMap<bool> &Features,
+      DiagnosticsEngine &Diags, StringRef CPU,
+      const std::vector<std::string> &FeaturesVec) const {
+  // Default for v60: -hvx, -hvx-double.
+  Features["hvx"] = false;
+  Features["hvx-double"] = false;
+
+  return TargetInfo::initFeatureMap(Features, Diags, CPU, FeaturesVec);
 }
 
-const char * const HexagonTargetInfo::GCCRegNames[] = {
+
+const char *const HexagonTargetInfo::GCCRegNames[] = {
   "r0", "r1", "r2", "r3", "r4", "r5", "r6", "r7",
   "r8", "r9", "r10", "r11", "r12", "r13", "r14", "r15",
   "r16", "r17", "r18", "r19", "r20", "r21", "r22", "r23",
@@ -5758,16 +5790,15 @@ const char * const HexagonTargetInfo::GC
   "sa0", "lc0", "sa1", "lc1", "m0", "m1", "usr", "ugp"
 };
 
-ArrayRef<const char *> HexagonTargetInfo::getGCCRegNames() const {
+ArrayRef<const char*> HexagonTargetInfo::getGCCRegNames() const {
   return llvm::makeArrayRef(GCCRegNames);
 }
 
-
 const TargetInfo::GCCRegAlias HexagonTargetInfo::GCCRegAliases[] = {
   { { "sp" }, "r29" },
   { { "fp" }, "r30" },
   { { "lr" }, "r31" },
- };
+};
 
 ArrayRef<TargetInfo::GCCRegAlias> HexagonTargetInfo::getGCCRegAliases() const {
   return llvm::makeArrayRef(GCCRegAliases);

Modified: cfe/trunk/lib/Driver/ToolChains.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/ToolChains.cpp?rev=255502&r1=255501&r2=255502&view=diff
==============================================================================
--- cfe/trunk/lib/Driver/ToolChains.cpp (original)
+++ cfe/trunk/lib/Driver/ToolChains.cpp Mon Dec 14 09:03:57 2015
@@ -2555,122 +2555,108 @@ std::string MipsLLVMToolChain::getCompil
 
 /// Hexagon Toolchain
 
-std::string HexagonToolChain::GetGnuDir(const std::string &InstalledDir,
-                                        const ArgList &Args) const {
-  // Locate the rest of the toolchain ...
-  std::string GccToolchain = getGCCToolchainDir(Args);
+std::string HexagonToolChain::getHexagonTargetDir(
+      const std::string &InstalledDir,
+      const SmallVectorImpl<std::string> &PrefixDirs) const {
+  std::string InstallRelDir;
+  const Driver &D = getDriver();
 
-  if (!GccToolchain.empty())
-    return GccToolchain;
+  // Locate the rest of the toolchain ...
+  for (auto &I : PrefixDirs)
+    if (D.getVFS().exists(I))
+      return I;
 
-  std::string InstallRelDir = InstalledDir + "/../../gnu";
-  if (getVFS().exists(InstallRelDir))
+  if (getVFS().exists(InstallRelDir = InstalledDir + "/../target"))
     return InstallRelDir;
 
-  std::string PrefixRelDir = std::string(LLVM_PREFIX) + "/../gnu";
+  std::string PrefixRelDir = std::string(LLVM_PREFIX) + "/target";
   if (getVFS().exists(PrefixRelDir))
     return PrefixRelDir;
 
   return InstallRelDir;
 }
 
-const char *HexagonToolChain::GetSmallDataThreshold(const ArgList &Args) {
-  Arg *A;
 
-  A = Args.getLastArg(options::OPT_G, options::OPT_G_EQ,
-                      options::OPT_msmall_data_threshold_EQ);
-  if (A)
-    return A->getValue();
+Optional<unsigned> HexagonToolChain::getSmallDataThreshold(
+      const ArgList &Args) {
+  StringRef Gn = "";
+  if (Arg *A = Args.getLastArg(options::OPT_G, options::OPT_G_EQ,
+                               options::OPT_msmall_data_threshold_EQ)) {
+    Gn = A->getValue();
+  } else if (Args.getLastArg(options::OPT_shared, options::OPT_fpic,
+                             options::OPT_fPIC)) {
+    Gn = "0";
+  }
 
-  A = Args.getLastArg(options::OPT_shared, options::OPT_fpic,
-                      options::OPT_fPIC);
-  if (A)
-    return "0";
+  unsigned G;
+  if (!Gn.getAsInteger(10, G))
+    return G;
 
-  return nullptr;
+  return None;
 }
 
-bool HexagonToolChain::UsesG0(const char *smallDataThreshold) {
-  return smallDataThreshold && smallDataThreshold[0] == '0';
-}
 
-static void GetHexagonLibraryPaths(const HexagonToolChain &TC,
-                                   const ArgList &Args, const std::string &Ver,
-                                   const std::string &MarchString,
-                                   const std::string &InstalledDir,
-                                   ToolChain::path_list *LibPaths) {
-  bool buildingLib = Args.hasArg(options::OPT_shared);
+void HexagonToolChain::getHexagonLibraryPaths(const ArgList &Args,
+      ToolChain::path_list &LibPaths) const {
+  const Driver &D = getDriver();
 
   //----------------------------------------------------------------------------
   // -L Args
   //----------------------------------------------------------------------------
   for (Arg *A : Args.filtered(options::OPT_L))
     for (const char *Value : A->getValues())
-      LibPaths->push_back(Value);
+      LibPaths.push_back(Value);
 
   //----------------------------------------------------------------------------
   // Other standard paths
   //----------------------------------------------------------------------------
-  const std::string MarchSuffix = "/" + MarchString;
-  const std::string G0Suffix = "/G0";
-  const std::string MarchG0Suffix = MarchSuffix + G0Suffix;
-  const std::string RootDir = TC.GetGnuDir(InstalledDir, Args) + "/";
-
-  // lib/gcc/hexagon/...
-  std::string LibGCCHexagonDir = RootDir + "lib/gcc/hexagon/";
-  if (buildingLib) {
-    LibPaths->push_back(LibGCCHexagonDir + Ver + MarchG0Suffix);
-    LibPaths->push_back(LibGCCHexagonDir + Ver + G0Suffix);
-  }
-  LibPaths->push_back(LibGCCHexagonDir + Ver + MarchSuffix);
-  LibPaths->push_back(LibGCCHexagonDir + Ver);
-
-  // lib/gcc/...
-  LibPaths->push_back(RootDir + "lib/gcc");
+  std::vector<std::string> RootDirs;
+  std::copy(D.PrefixDirs.begin(), D.PrefixDirs.end(), RootDirs.begin());
 
-  // hexagon/lib/...
-  std::string HexagonLibDir = RootDir + "hexagon/lib";
-  if (buildingLib) {
-    LibPaths->push_back(HexagonLibDir + MarchG0Suffix);
-    LibPaths->push_back(HexagonLibDir + G0Suffix);
+  std::string TargetDir = getHexagonTargetDir(D.getInstalledDir(),
+                                              D.PrefixDirs);
+  if (std::find(RootDirs.begin(), RootDirs.end(), TargetDir) == RootDirs.end())
+    RootDirs.push_back(TargetDir);
+
+  bool HasPIC = Args.hasArg(options::OPT_fpic, options::OPT_fPIC);
+  // Assume G0 with -shared.
+  bool HasG0 = Args.hasArg(options::OPT_shared);
+  if (auto G = getSmallDataThreshold(Args))
+    HasG0 = G.getValue() == 0;
+
+  const std::string CpuVer = GetTargetCPUVersion(Args).str();
+  for (auto &Dir : RootDirs) {
+    std::string LibDir = Dir + "/hexagon/lib";
+    std::string LibDirCpu = LibDir + '/' + CpuVer;
+    if (HasG0) {
+      if (HasPIC)
+        LibPaths.push_back(LibDirCpu + "/G0/pic");
+      LibPaths.push_back(LibDirCpu + "/G0");
+    }
+    LibPaths.push_back(LibDirCpu);
+    LibPaths.push_back(LibDir);
   }
-  LibPaths->push_back(HexagonLibDir + MarchSuffix);
-  LibPaths->push_back(HexagonLibDir);
 }
 
 HexagonToolChain::HexagonToolChain(const Driver &D, const llvm::Triple &Triple,
-                                   const ArgList &Args)
+                                   const llvm::opt::ArgList &Args)
     : Linux(D, Triple, Args) {
-  const std::string InstalledDir(getDriver().getInstalledDir());
-  const std::string GnuDir = GetGnuDir(InstalledDir, Args);
+  const std::string TargetDir = getHexagonTargetDir(D.getInstalledDir(),
+                                                    D.PrefixDirs);
 
   // Note: Generic_GCC::Generic_GCC adds InstalledDir and getDriver().Dir to
   // program paths
-  const std::string BinDir(GnuDir + "/bin");
+  const std::string BinDir(TargetDir + "/bin");
   if (D.getVFS().exists(BinDir))
     getProgramPaths().push_back(BinDir);
 
-  // Determine version of GCC libraries and headers to use.
-  const std::string HexagonDir(GnuDir + "/lib/gcc/hexagon");
-  std::error_code ec;
-  GCCVersion MaxVersion = GCCVersion::Parse("0.0.0");
-  for (vfs::directory_iterator di = D.getVFS().dir_begin(HexagonDir, ec), de;
-       !ec && di != de; di = di.increment(ec)) {
-    GCCVersion cv = GCCVersion::Parse(llvm::sys::path::filename(di->getName()));
-    if (MaxVersion < cv)
-      MaxVersion = cv;
-  }
-  GCCLibAndIncVersion = MaxVersion;
-
-  ToolChain::path_list *LibPaths = &getFilePaths();
+  ToolChain::path_list &LibPaths = getFilePaths();
 
   // Remove paths added by Linux toolchain. Currently Hexagon_TC really targets
   // 'elf' OS type, so the Linux paths are not appropriate. When we actually
   // support 'linux' we'll need to fix this up
-  LibPaths->clear();
-
-  GetHexagonLibraryPaths(*this, Args, GetGCCLibAndIncVersion(),
-                         GetTargetCPU(Args), InstalledDir, LibPaths);
+  LibPaths.clear();
+  getHexagonLibraryPaths(Args, LibPaths);
 }
 
 HexagonToolChain::~HexagonToolChain() {}
@@ -2685,18 +2671,14 @@ Tool *HexagonToolChain::buildLinker() co
 
 void HexagonToolChain::AddClangSystemIncludeArgs(const ArgList &DriverArgs,
                                                  ArgStringList &CC1Args) const {
-  const Driver &D = getDriver();
-
   if (DriverArgs.hasArg(options::OPT_nostdinc) ||
       DriverArgs.hasArg(options::OPT_nostdlibinc))
     return;
 
-  std::string Ver(GetGCCLibAndIncVersion());
-  std::string GnuDir = GetGnuDir(D.InstalledDir, DriverArgs);
-  std::string HexagonDir(GnuDir + "/lib/gcc/hexagon/" + Ver);
-  addExternCSystemInclude(DriverArgs, CC1Args, HexagonDir + "/include");
-  addExternCSystemInclude(DriverArgs, CC1Args, HexagonDir + "/include-fixed");
-  addExternCSystemInclude(DriverArgs, CC1Args, GnuDir + "/hexagon/include");
+  const Driver &D = getDriver();
+  std::string TargetDir = getHexagonTargetDir(D.getInstalledDir(),
+                                              D.PrefixDirs);
+  addExternCSystemInclude(DriverArgs, CC1Args, TargetDir + "/hexagon/include");
 }
 
 void HexagonToolChain::AddClangCXXStdlibIncludeArgs(
@@ -2706,12 +2688,8 @@ void HexagonToolChain::AddClangCXXStdlib
     return;
 
   const Driver &D = getDriver();
-  std::string Ver(GetGCCLibAndIncVersion());
-  SmallString<128> IncludeDir(GetGnuDir(D.InstalledDir, DriverArgs));
-
-  llvm::sys::path::append(IncludeDir, "hexagon/include/c++/");
-  llvm::sys::path::append(IncludeDir, Ver);
-  addSystemInclude(DriverArgs, CC1Args, IncludeDir);
+  std::string TargetDir = getHexagonTargetDir(D.InstalledDir, D.PrefixDirs);
+  addSystemInclude(DriverArgs, CC1Args, TargetDir + "/hexagon/include/c++");
 }
 
 ToolChain::CXXStdlibType
@@ -2721,53 +2699,34 @@ HexagonToolChain::GetCXXStdlibType(const
     return ToolChain::CST_Libstdcxx;
 
   StringRef Value = A->getValue();
-  if (Value != "libstdc++") {
+  if (Value != "libstdc++")
     getDriver().Diag(diag::err_drv_invalid_stdlib_name) << A->getAsString(Args);
-  }
 
   return ToolChain::CST_Libstdcxx;
 }
 
-static int getHexagonVersion(const ArgList &Args) {
-  Arg *A = Args.getLastArg(options::OPT_march_EQ, options::OPT_mcpu_EQ);
-  // Select the default CPU (v4) if none was given.
-  if (!A)
-    return 4;
-
-  // FIXME: produce errors if we cannot parse the version.
-  StringRef WhichHexagon = A->getValue();
-  if (WhichHexagon.startswith("hexagonv")) {
-    int Val;
-    if (!WhichHexagon.substr(sizeof("hexagonv") - 1).getAsInteger(10, Val))
-      return Val;
-  }
-  if (WhichHexagon.startswith("v")) {
-    int Val;
-    if (!WhichHexagon.substr(1).getAsInteger(10, Val))
-      return Val;
-  }
-
-  // FIXME: should probably be an error.
-  return 4;
-}
-
-StringRef HexagonToolChain::GetTargetCPU(const ArgList &Args) {
-  int V = getHexagonVersion(Args);
-  // FIXME: We don't support versions < 4. We should error on them.
-  switch (V) {
-  default:
-    llvm_unreachable("Unexpected version");
-  case 5:
-    return "v5";
-  case 4:
-    return "v4";
-  case 3:
-    return "v3";
-  case 2:
-    return "v2";
-  case 1:
-    return "v1";
-  }
+//
+// Returns the default CPU for Hexagon. This is the default compilation target
+// if no Hexagon processor is selected at the command-line.
+//
+const StringRef HexagonToolChain::GetDefaultCPU() {
+  return "hexagonv60";
+}
+
+const StringRef HexagonToolChain::GetTargetCPUVersion(const ArgList &Args) {
+  Arg *CpuArg = nullptr;
+
+  for (auto &A : Args) {
+    if (A->getOption().matches(options::OPT_mcpu_EQ)) {
+      CpuArg = A;
+      A->claim();
+    }
+  }
+
+  StringRef CPU = CpuArg ? CpuArg->getValue() : GetDefaultCPU();
+  if (CPU.startswith("hexagon"))
+    return CPU.substr(sizeof("hexagon") - 1);
+  return CPU;
 }
 // End Hexagon
 

Modified: cfe/trunk/lib/Driver/ToolChains.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/ToolChains.h?rev=255502&r1=255501&r2=255502&view=diff
==============================================================================
--- cfe/trunk/lib/Driver/ToolChains.h (original)
+++ cfe/trunk/lib/Driver/ToolChains.h Mon Dec 14 09:03:57 2015
@@ -875,14 +875,17 @@ public:
     return true;
   }
 
-  std::string GetGnuDir(const std::string &InstalledDir,
-                        const llvm::opt::ArgList &Args) const;
+  std::string getHexagonTargetDir(
+      const std::string &InstalledDir,
+      const SmallVectorImpl<std::string> &PrefixDirs) const;
+  void getHexagonLibraryPaths(const llvm::opt::ArgList &Args,
+      ToolChain::path_list &LibPaths) const;
 
-  static StringRef GetTargetCPU(const llvm::opt::ArgList &Args);
+  static const StringRef GetDefaultCPU();
+  static const StringRef GetTargetCPUVersion(const llvm::opt::ArgList &Args);
 
-  static const char *GetSmallDataThreshold(const llvm::opt::ArgList &Args);
-
-  static bool UsesG0(const char *smallDataThreshold);
+  static Optional<unsigned> getSmallDataThreshold(
+      const llvm::opt::ArgList &Args);
 };
 
 class LLVM_LIBRARY_VISIBILITY AMDGPUToolChain : public Generic_ELF {

Modified: cfe/trunk/lib/Driver/Tools.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/Tools.cpp?rev=255502&r1=255501&r2=255502&view=diff
==============================================================================
--- cfe/trunk/lib/Driver/Tools.cpp (original)
+++ cfe/trunk/lib/Driver/Tools.cpp Mon Dec 14 09:03:57 2015
@@ -1714,7 +1714,8 @@ static std::string getCPUName(const ArgL
     return getX86TargetCPU(Args, T);
 
   case llvm::Triple::hexagon:
-    return "hexagon" + toolchains::HexagonToolChain::GetTargetCPU(Args).str();
+    return "hexagon" +
+           toolchains::HexagonToolChain::GetTargetCPUVersion(Args).str();
 
   case llvm::Triple::systemz:
     return getSystemZTargetCPU(Args);
@@ -1997,12 +1998,11 @@ void Clang::AddHexagonTargetArgs(const A
   CmdArgs.push_back("-mqdsp6-compat");
   CmdArgs.push_back("-Wreturn-type");
 
-  if (const char *v =
-          toolchains::HexagonToolChain::GetSmallDataThreshold(Args)) {
-    std::string SmallDataThreshold = "-hexagon-small-data-threshold=";
-    SmallDataThreshold += v;
+  if (auto G = toolchains::HexagonToolChain::getSmallDataThreshold(Args)) {
+    std::string N = llvm::utostr(G.getValue());
+    std::string Opt = std::string("-hexagon-small-data-threshold=") + N;
     CmdArgs.push_back("-mllvm");
-    CmdArgs.push_back(Args.MakeArgString(SmallDataThreshold));
+    CmdArgs.push_back(Args.MakeArgString(Opt));
   }
 
   if (!Args.hasArg(options::OPT_fno_short_enums))
@@ -2182,6 +2182,29 @@ static void getAArch64TargetFeatures(con
     Features.push_back("+reserve-x18");
 }
 
+static void getHexagonTargetFeatures(const ArgList &Args,
+                                     std::vector<const char *> &Features) {
+  bool HasHVX = false, HasHVXD = false;
+
+  for (auto &A : Args) {
+    auto &Opt = A->getOption();
+    if (Opt.matches(options::OPT_mhexagon_hvx))
+      HasHVX = true;
+    else if (Opt.matches(options::OPT_mno_hexagon_hvx))
+      HasHVXD = HasHVX = false;
+    else if (Opt.matches(options::OPT_mhexagon_hvx_double))
+      HasHVXD = HasHVX = true;
+    else if (Opt.matches(options::OPT_mno_hexagon_hvx_double))
+      HasHVXD = false;
+    else
+      continue;
+    A->claim();
+  }
+
+  Features.push_back(HasHVX  ? "+hvx" : "-hvx");
+  Features.push_back(HasHVXD ? "+hvx-double" : "-hvx-double");
+}
+
 static void getWebAssemblyTargetFeatures(const ArgList &Args,
                                          std::vector<const char *> &Features) {
   for (const Arg *A : Args.filtered(options::OPT_m_wasm_Features_Group)) {
@@ -2238,6 +2261,9 @@ static void getTargetFeatures(const Tool
   case llvm::Triple::x86_64:
     getX86TargetFeatures(D, Triple, Args, Features);
     break;
+  case llvm::Triple::hexagon:
+    getHexagonTargetFeatures(Args, Features);
+    break;
   case llvm::Triple::wasm32:
   case llvm::Triple::wasm64:
     getWebAssemblyTargetFeatures(Args, Features);
@@ -6049,7 +6075,9 @@ void gcc::Linker::RenderExtraToolArgs(co
 
 // Hexagon tools start.
 void hexagon::Assembler::RenderExtraToolArgs(const JobAction &JA,
-                                             ArgStringList &CmdArgs) const {}
+                                             ArgStringList &CmdArgs) const {
+}
+
 void hexagon::Assembler::ConstructJob(Compilation &C, const JobAction &JA,
                                       const InputInfo &Output,
                                       const InputInfoList &Inputs,
@@ -6057,15 +6085,21 @@ void hexagon::Assembler::ConstructJob(Co
                                       const char *LinkingOutput) const {
   claimNoWarnArgs(Args);
 
-  const Driver &D = getToolChain().getDriver();
+  auto &HTC = static_cast<const toolchains::HexagonToolChain&>(getToolChain());
+  const Driver &D = HTC.getDriver();
   ArgStringList CmdArgs;
 
-  std::string MarchString = "-march=";
-  MarchString += toolchains::HexagonToolChain::GetTargetCPU(Args);
-  CmdArgs.push_back(Args.MakeArgString(MarchString));
+  std::string MArchString = "-march=hexagon";
+  CmdArgs.push_back(Args.MakeArgString(MArchString));
 
   RenderExtraToolArgs(JA, CmdArgs);
 
+  std::string AsName = "hexagon-llvm-mc";
+  std::string MCpuString = "-mcpu=hexagon" +
+        toolchains::HexagonToolChain::GetTargetCPUVersion(Args).str();
+  CmdArgs.push_back("-filetype=obj");
+  CmdArgs.push_back(Args.MakeArgString(MCpuString));
+
   if (Output.isFilename()) {
     CmdArgs.push_back("-o");
     CmdArgs.push_back(Output.getFilename());
@@ -6074,8 +6108,10 @@ void hexagon::Assembler::ConstructJob(Co
     CmdArgs.push_back("-fsyntax-only");
   }
 
-  if (const char *v = toolchains::HexagonToolChain::GetSmallDataThreshold(Args))
-    CmdArgs.push_back(Args.MakeArgString(std::string("-G") + v));
+  if (auto G = toolchains::HexagonToolChain::getSmallDataThreshold(Args)) {
+    std::string N = llvm::utostr(G.getValue());
+    CmdArgs.push_back(Args.MakeArgString(std::string("-gpsize=") + N));
+  }
 
   Args.AddAllArgValues(CmdArgs, options::OPT_Wa_COMMA, options::OPT_Xassembler);
 
@@ -6091,13 +6127,13 @@ void hexagon::Assembler::ConstructJob(Co
     // Don't try to pass LLVM or AST inputs to a generic gcc.
     if (types::isLLVMIR(II.getType()))
       D.Diag(clang::diag::err_drv_no_linker_llvm_support)
-          << getToolChain().getTripleString();
+          << HTC.getTripleString();
     else if (II.getType() == types::TY_AST)
       D.Diag(clang::diag::err_drv_no_ast_support)
-          << getToolChain().getTripleString();
+          << HTC.getTripleString();
     else if (II.getType() == types::TY_ModuleFile)
       D.Diag(diag::err_drv_no_module_support)
-          << getToolChain().getTripleString();
+          << HTC.getTripleString();
 
     if (II.isFilename())
       CmdArgs.push_back(II.getFilename());
@@ -6107,41 +6143,38 @@ void hexagon::Assembler::ConstructJob(Co
       II.getInputArg().render(Args, CmdArgs);
   }
 
-  const char *GCCName = "hexagon-as";
-  const char *Exec = Args.MakeArgString(getToolChain().GetProgramPath(GCCName));
+  auto *Exec = Args.MakeArgString(HTC.GetProgramPath(AsName.c_str()));
   C.addCommand(llvm::make_unique<Command>(JA, *this, Exec, CmdArgs, Inputs));
 }
 
 void hexagon::Linker::RenderExtraToolArgs(const JobAction &JA,
                                           ArgStringList &CmdArgs) const {
-  // The types are (hopefully) good enough.
 }
 
 static void
 constructHexagonLinkArgs(Compilation &C, const JobAction &JA,
-                         const toolchains::HexagonToolChain &ToolChain,
+                         const toolchains::HexagonToolChain &HTC,
                          const InputInfo &Output, const InputInfoList &Inputs,
                          const ArgList &Args, ArgStringList &CmdArgs,
                          const char *LinkingOutput) {
 
-  const Driver &D = ToolChain.getDriver();
+  const Driver &D = HTC.getDriver();
 
   //----------------------------------------------------------------------------
   //
   //----------------------------------------------------------------------------
-  bool hasStaticArg = Args.hasArg(options::OPT_static);
-  bool buildingLib = Args.hasArg(options::OPT_shared);
-  bool buildPIE = Args.hasArg(options::OPT_pie);
-  bool incStdLib = !Args.hasArg(options::OPT_nostdlib);
-  bool incStartFiles = !Args.hasArg(options::OPT_nostartfiles);
-  bool incDefLibs = !Args.hasArg(options::OPT_nodefaultlibs);
-  bool useG0 = false;
-  bool useShared = buildingLib && !hasStaticArg;
+  bool IsStatic = Args.hasArg(options::OPT_static);
+  bool IsShared = Args.hasArg(options::OPT_shared);
+  bool IsPIE = Args.hasArg(options::OPT_pie);
+  bool IncStdLib = !Args.hasArg(options::OPT_nostdlib);
+  bool IncStartFiles = !Args.hasArg(options::OPT_nostartfiles);
+  bool IncDefLibs = !Args.hasArg(options::OPT_nodefaultlibs);
+  bool UseG0 = false;
+  bool UseShared = IsShared && !IsStatic;
 
   //----------------------------------------------------------------------------
   // Silence warnings for various options
   //----------------------------------------------------------------------------
-
   Args.ClaimAllArgs(options::OPT_g_Group);
   Args.ClaimAllArgs(options::OPT_emit_llvm);
   Args.ClaimAllArgs(options::OPT_w); // Other warning options are already
@@ -6151,28 +6184,37 @@ constructHexagonLinkArgs(Compilation &C,
   //----------------------------------------------------------------------------
   //
   //----------------------------------------------------------------------------
-  for (const auto &Opt : ToolChain.ExtraOpts)
+  if (Args.hasArg(options::OPT_s))
+    CmdArgs.push_back("-s");
+
+  if (Args.hasArg(options::OPT_r))
+    CmdArgs.push_back("-r");
+
+  for (const auto &Opt : HTC.ExtraOpts)
     CmdArgs.push_back(Opt.c_str());
 
-  std::string MarchString = toolchains::HexagonToolChain::GetTargetCPU(Args);
-  CmdArgs.push_back(Args.MakeArgString("-m" + MarchString));
+  CmdArgs.push_back("-march=hexagon");
+  std::string CpuVer =
+        toolchains::HexagonToolChain::GetTargetCPUVersion(Args).str();
+  std::string MCpuString = "-mcpu=hexagon" + CpuVer;
+  CmdArgs.push_back(Args.MakeArgString(MCpuString));
 
-  if (buildingLib) {
+  if (IsShared) {
     CmdArgs.push_back("-shared");
-    CmdArgs.push_back("-call_shared"); // should be the default, but doing as
-                                       // hexagon-gcc does
+    // The following should be the default, but doing as hexagon-gcc does.
+    CmdArgs.push_back("-call_shared");
   }
 
-  if (hasStaticArg)
+  if (IsStatic)
     CmdArgs.push_back("-static");
 
-  if (buildPIE && !buildingLib)
+  if (IsPIE && !IsShared)
     CmdArgs.push_back("-pie");
 
-  if (const char *v =
-          toolchains::HexagonToolChain::GetSmallDataThreshold(Args)) {
-    CmdArgs.push_back(Args.MakeArgString(std::string("-G") + v));
-    useG0 = toolchains::HexagonToolChain::UsesG0(v);
+  if (auto G = toolchains::HexagonToolChain::getSmallDataThreshold(Args)) {
+    std::string N = llvm::utostr(G.getValue());
+    CmdArgs.push_back(Args.MakeArgString(std::string("-G") + N));
+    UseG0 = G.getValue() == 0;
   }
 
   //----------------------------------------------------------------------------
@@ -6181,49 +6223,62 @@ constructHexagonLinkArgs(Compilation &C,
   CmdArgs.push_back("-o");
   CmdArgs.push_back(Output.getFilename());
 
-  const std::string MarchSuffix = "/" + MarchString;
-  const std::string G0Suffix = "/G0";
-  const std::string MarchG0Suffix = MarchSuffix + G0Suffix;
-  const std::string RootDir = ToolChain.GetGnuDir(D.InstalledDir, Args) + "/";
-  const std::string StartFilesDir =
-      RootDir + "hexagon/lib" + (useG0 ? MarchG0Suffix : MarchSuffix);
-
   //----------------------------------------------------------------------------
   // moslib
   //----------------------------------------------------------------------------
-  std::vector<std::string> oslibs;
-  bool hasStandalone = false;
+  std::vector<std::string> OsLibs;
+  bool HasStandalone = false;
 
   for (const Arg *A : Args.filtered(options::OPT_moslib_EQ)) {
     A->claim();
-    oslibs.emplace_back(A->getValue());
-    hasStandalone = hasStandalone || (oslibs.back() == "standalone");
+    OsLibs.emplace_back(A->getValue());
+    HasStandalone = HasStandalone || (OsLibs.back() == "standalone");
   }
-  if (oslibs.empty()) {
-    oslibs.push_back("standalone");
-    hasStandalone = true;
+  if (OsLibs.empty()) {
+    OsLibs.push_back("standalone");
+    HasStandalone = true;
   }
 
   //----------------------------------------------------------------------------
   // Start Files
   //----------------------------------------------------------------------------
-  if (incStdLib && incStartFiles) {
-
-    if (!buildingLib) {
-      if (hasStandalone) {
-        CmdArgs.push_back(
-            Args.MakeArgString(StartFilesDir + "/crt0_standalone.o"));
+  const std::string MCpuSuffix = "/" + CpuVer;
+  const std::string MCpuG0Suffix = MCpuSuffix + "/G0";
+  const std::string RootDir =
+      HTC.getHexagonTargetDir(D.InstalledDir, D.PrefixDirs) + "/";
+  const std::string StartSubDir =
+      "hexagon/lib" + (UseG0 ? MCpuG0Suffix : MCpuSuffix);
+
+  auto Find = [&HTC] (const std::string &RootDir, const std::string &SubDir,
+                      const char *Name) -> std::string {
+    std::string RelName = SubDir + Name;
+    std::string P = HTC.GetFilePath(RelName.c_str());
+    if (llvm::sys::fs::exists(P))
+      return P;
+    return RootDir + RelName;
+  };
+
+  if (IncStdLib && IncStartFiles) {
+    if (!IsShared) {
+      if (HasStandalone) {
+        std::string Crt0SA = Find(RootDir, StartSubDir, "/crt0_standalone.o");
+        CmdArgs.push_back(Args.MakeArgString(Crt0SA));
       }
-      CmdArgs.push_back(Args.MakeArgString(StartFilesDir + "/crt0.o"));
+      std::string Crt0 = Find(RootDir, StartSubDir, "/crt0.o");
+      CmdArgs.push_back(Args.MakeArgString(Crt0));
     }
-    std::string initObj = useShared ? "/initS.o" : "/init.o";
-    CmdArgs.push_back(Args.MakeArgString(StartFilesDir + initObj));
+    std::string Init = UseShared
+          ? Find(RootDir, StartSubDir + "/pic", "/initS.o")
+          : Find(RootDir, StartSubDir, "/init.o");
+    CmdArgs.push_back(Args.MakeArgString(Init));
   }
 
   //----------------------------------------------------------------------------
   // Library Search Paths
   //----------------------------------------------------------------------------
-  ToolChain.AddFilePathLibArgs(Args, CmdArgs);
+  const ToolChain::path_list &LibPaths = HTC.getFilePaths();
+  for (const auto &LibPath : LibPaths)
+    CmdArgs.push_back(Args.MakeArgString(StringRef("-L") + LibPath));
 
   //----------------------------------------------------------------------------
   //
@@ -6232,21 +6287,21 @@ constructHexagonLinkArgs(Compilation &C,
                   {options::OPT_T_Group, options::OPT_e, options::OPT_s,
                    options::OPT_t, options::OPT_u_Group});
 
-  AddLinkerInputs(ToolChain, Inputs, Args, CmdArgs);
+  AddLinkerInputs(HTC, Inputs, Args, CmdArgs);
 
   //----------------------------------------------------------------------------
   // Libraries
   //----------------------------------------------------------------------------
-  if (incStdLib && incDefLibs) {
+  if (IncStdLib && IncDefLibs) {
     if (D.CCCIsCXX()) {
-      ToolChain.AddCXXStdlibLibArgs(Args, CmdArgs);
+      HTC.AddCXXStdlibLibArgs(Args, CmdArgs);
       CmdArgs.push_back("-lm");
     }
 
     CmdArgs.push_back("--start-group");
 
-    if (!buildingLib) {
-      for (const std::string &Lib : oslibs)
+    if (!IsShared) {
+      for (const std::string &Lib : OsLibs)
         CmdArgs.push_back(Args.MakeArgString("-l" + Lib));
       CmdArgs.push_back("-lc");
     }
@@ -6258,9 +6313,11 @@ constructHexagonLinkArgs(Compilation &C,
   //----------------------------------------------------------------------------
   // End files
   //----------------------------------------------------------------------------
-  if (incStdLib && incStartFiles) {
-    std::string finiObj = useShared ? "/finiS.o" : "/fini.o";
-    CmdArgs.push_back(Args.MakeArgString(StartFilesDir + finiObj));
+  if (IncStdLib && IncStartFiles) {
+    std::string Fini = UseShared
+          ? Find(RootDir, StartSubDir + "/pic", "/finiS.o")
+          : Find(RootDir, StartSubDir, "/fini.o");
+    CmdArgs.push_back(Args.MakeArgString(Fini));
   }
 }
 
@@ -6269,15 +6326,13 @@ void hexagon::Linker::ConstructJob(Compi
                                    const InputInfoList &Inputs,
                                    const ArgList &Args,
                                    const char *LinkingOutput) const {
-
-  const toolchains::HexagonToolChain &ToolChain =
-      static_cast<const toolchains::HexagonToolChain &>(getToolChain());
+  auto &HTC = static_cast<const toolchains::HexagonToolChain&>(getToolChain());
 
   ArgStringList CmdArgs;
-  constructHexagonLinkArgs(C, JA, ToolChain, Output, Inputs, Args, CmdArgs,
+  constructHexagonLinkArgs(C, JA, HTC, Output, Inputs, Args, CmdArgs,
                            LinkingOutput);
 
-  std::string Linker = ToolChain.GetProgramPath("hexagon-ld");
+  std::string Linker = HTC.GetProgramPath("hexagon-link");
   C.addCommand(llvm::make_unique<Command>(JA, *this, Args.MakeArgString(Linker),
                                           CmdArgs, Inputs));
 }

Modified: cfe/trunk/test/CodeGen/target-data.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/target-data.c?rev=255502&r1=255501&r2=255502&view=diff
==============================================================================
--- cfe/trunk/test/CodeGen/target-data.c (original)
+++ cfe/trunk/test/CodeGen/target-data.c Mon Dec 14 09:03:57 2015
@@ -157,7 +157,7 @@
 
 // RUN: %clang_cc1 -triple hexagon-unknown -o - -emit-llvm %s | \
 // RUN: FileCheck %s -check-prefix=HEXAGON
-// HEXAGON: target datalayout = "e-m:e-p:32:32-i1:32-i64:64-a:0-n32"
+// HEXAGON: target datalayout = "e-m:e-p:32:32:32-i64:64:64-i32:32:32-i16:16:16-i1:8:8-f64:64:64-f32:32:32-v64:64:64-v32:32:32-a:0-n16:32"
 
 // RUN: %clang_cc1 -triple s390x-unknown -o - -emit-llvm %s | \
 // RUN: FileCheck %s -check-prefix=SYSTEMZ

Modified: cfe/trunk/test/Driver/hexagon-toolchain-elf.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/hexagon-toolchain-elf.c?rev=255502&r1=255501&r2=255502&view=diff
==============================================================================
--- cfe/trunk/test/Driver/hexagon-toolchain-elf.c (original)
+++ cfe/trunk/test/Driver/hexagon-toolchain-elf.c Mon Dec 14 09:03:57 2015
@@ -2,135 +2,92 @@
 // Test standard include paths
 // -----------------------------------------------------------------------------
 
-// RUN: %clang -### -target hexagon-unknown-elf -fno-integrated-as    \
-// RUN:   -ccc-install-dir %S/Inputs/hexagon_tree/qc/bin \
-// RUN:   --gcc-toolchain="" \
+// RUN: %clang -### -target hexagon-unknown-elf \
+// RUN:   -ccc-install-dir %S/Inputs/hexagon_tree/Tools/bin \
 // RUN:   %s 2>&1 \
-// RUN:   | FileCheck -check-prefix=CHECK001 %s
-// CHECK001: "-cc1" {{.*}} "-internal-externc-isystem" "{{.*}}/Inputs/hexagon_tree/qc/bin/../../gnu/lib/gcc/hexagon/4.4.0/include"
-// CHECK001:   "-internal-externc-isystem" "{{.*}}/Inputs/hexagon_tree/qc/bin/../../gnu/lib/gcc/hexagon/4.4.0/include-fixed"
-// CHECK001:   "-internal-externc-isystem" "{{.*}}/Inputs/hexagon_tree/qc/bin/../../gnu/hexagon/include"
-// CHECK001-NEXT: "{{.*}}/Inputs/hexagon_tree/qc/bin/../../gnu/bin{{/|\\\\}}hexagon-as"
+// RUN:   | FileCheck -check-prefix=CHECK000 %s
+// CHECK000: "-cc1" {{.*}} "-internal-externc-isystem" "{{.*}}/Inputs/hexagon_tree/Tools/bin/../target/hexagon/include"
 
-// RUN: %clangxx -### -target hexagon-unknown-elf -fno-integrated-as    \
-// RUN:   -ccc-install-dir %S/Inputs/hexagon_tree/qc/bin \
-// RUN:   --gcc-toolchain="" \
+// RUN: %clangxx -### -target hexagon-unknown-elf \
+// RUN:   -ccc-install-dir %S/Inputs/hexagon_tree/Tools/bin \
 // RUN:   %s 2>&1 \
-// RUN:   | FileCheck -check-prefix=CHECK002 %s
-// CHECK002: "-cc1" {{.*}} "-internal-isystem" "[[INSTALL_DIR:.*]]/Inputs/hexagon_tree/qc/bin/../../gnu{{/|\\\\}}hexagon/include/c++/4.4.0"
-// CHECK002:   "-internal-externc-isystem" "{{.*}}/Inputs/hexagon_tree/qc/bin/../../gnu/lib/gcc/hexagon/4.4.0/include"
-// CHECK002:   "-internal-externc-isystem" "{{.*}}/Inputs/hexagon_tree/qc/bin/../../gnu/lib/gcc/hexagon/4.4.0/include-fixed"
-// CHECK002:   "-internal-externc-isystem" "{{.*}}/Inputs/hexagon_tree/qc/bin/../../gnu/hexagon/include"
-// CHECK002-NEXT: "{{.*}}/Inputs/hexagon_tree/qc/bin/../../gnu/bin{{/|\\\\}}hexagon-as"
+// RUN:   | FileCheck -check-prefix=CHECK001 %s
+// CHECK001: "-cc1" {{.*}} "-internal-isystem" "{{.*}}/Inputs/hexagon_tree/Tools/bin/../target/hexagon/include/c++"
+// CHECK001:   "-internal-externc-isystem" "{{.*}}/Inputs/hexagon_tree/Tools/bin/../target/hexagon/include"
 
 // -----------------------------------------------------------------------------
 // Test -nostdinc, -nostdlibinc, -nostdinc++
 // -----------------------------------------------------------------------------
 
-// RUN: %clang -### -target hexagon-unknown-elf -fno-integrated-as    \
-// RUN:   -ccc-install-dir %S/Inputs/hexagon_tree/qc/bin \
-// RUN:   --gcc-toolchain="" \
+// RUN: %clang -### -target hexagon-unknown-elf \
+// RUN:   -ccc-install-dir %S/Inputs/hexagon_tree/Tools/bin \
 // RUN:   -nostdinc \
 // RUN:   %s 2>&1 \
-// RUN:   | FileCheck -check-prefix=CHECK003 %s
-// CHECK003: "-cc1"
-// CHECK003-NOT: "-internal-externc-isystem" "{{.*}}/Inputs/hexagon_tree/qc/bin/../../gnu/lib/gcc/hexagon/4.4.0/include"
-// CHECK003-NOT: "-internal-externc-isystem" "{{.*}}/Inputs/hexagon_tree/qc/bin/../../gnu/lib/gcc/hexagon/4.4.0/include-fixed"
-// CHECK003-NOT: "-internal-externc-isystem" "{{.*}}/Inputs/hexagon_tree/qc/bin/../../gnu/hexagon/include"
-// CHECK003-NEXT: "{{.*}}/Inputs/hexagon_tree/qc/bin/../../gnu/bin{{/|\\\\}}hexagon-as"
+// RUN:   | FileCheck -check-prefix=CHECK010 %s
+// CHECK010: "-cc1"
+// CHECK010-NOT: "-internal-externc-isystem"
 
-// RUN: %clang -### -target hexagon-unknown-elf -fno-integrated-as    \
-// RUN:   -ccc-install-dir %S/Inputs/hexagon_tree/qc/bin \
-// RUN:   --gcc-toolchain="" \
+// RUN: %clang -### -target hexagon-unknown-elf \
+// RUN:   -ccc-install-dir %S/Inputs/hexagon_tree/Tools/bin \
 // RUN:   -nostdlibinc \
 // RUN:   %s 2>&1 \
-// RUN:   | FileCheck -check-prefix=CHECK004 %s
-// CHECK004: "-cc1"
-// CHECK004-NOT: "-internal-externc-isystem" "{{.*}}/Inputs/hexagon_tree/qc/bin/../../gnu/lib/gcc/hexagon/4.4.0/include"
-// CHECK004-NOT: "-internal-externc-isystem" "{{.*}}/Inputs/hexagon_tree/qc/bin/../../gnu/lib/gcc/hexagon/4.4.0/include-fixed"
-// CHECK004-NOT: "-internal-externc-isystem" "{{.*}}/Inputs/hexagon_tree/qc/bin/../../gnu/hexagon/include"
-// CHECK004-NEXT: "{{.*}}/Inputs/hexagon_tree/qc/bin/../../gnu/bin{{/|\\\\}}hexagon-as"
+// RUN:   | FileCheck -check-prefix=CHECK011 %s
+// CHECK011: "-cc1"
+// CHECK011-NOT: "-internal-externc-isystem"
 
-// RUN: %clangxx -### -target hexagon-unknown-elf -fno-integrated-as    \
-// RUN:   -ccc-install-dir %S/Inputs/hexagon_tree/qc/bin \
-// RUN:   --gcc-toolchain="" \
-// RUN:   -nostdlibinc \
+// RUN: %clangxx -### -target hexagon-unknown-elf \
+// RUN:   -ccc-install-dir %S/Inputs/hexagon_tree/Tools/bin \
+// RUN:   -nostdinc++ \
 // RUN:   %s 2>&1 \
-// RUN:   | FileCheck -check-prefix=CHECK005 %s
-// CHECK005: "-cc1"
-// CHECK005-NOT: "-internal-isystem" "{{.*}}/Inputs/hexagon_tree/qc/bin/../../gnu/hexagon/include/c++/4.4.0"
-// CHECK005-NOT: "-internal-externc-isystem" "{{.*}}/Inputs/hexagon_tree/qc/bin/../../gnu/lib/gcc/hexagon/4.4.0/include"
-// CHECK005-NOT: "-internal-externc-isystem" "{{.*}}/Inputs/hexagon_tree/qc/bin/../../gnu/lib/gcc/hexagon/4.4.0/include-fixed"
-// CHECK005-NOT: "-internal-externc-isystem" "{{.*}}/Inputs/hexagon_tree/qc/bin/../../gnu/hexagon/include"
-// CHECK005-NEXT: "{{.*}}/Inputs/hexagon_tree/qc/bin/../../gnu/bin{{/|\\\\}}hexagon-as"
+// RUN:   | FileCheck -check-prefix=CHECK012 %s
+// CHECK012: "-cc1"
+// CHECK012-DAG-NOT: "-internal-isystem"
+// CHECK012-DAG: "-internal-externc-isystem" "{{.*}}/Inputs/hexagon_tree/Tools/bin/../target/hexagon/include"
 
 // RUN: %clangxx -### -target hexagon-unknown-elf -fno-integrated-as    \
 // RUN:   -ccc-install-dir %S/Inputs/hexagon_tree/qc/bin \
 // RUN:   --gcc-toolchain="" \
-// RUN:   -nostdinc++ \
+// RUN:   -nostdlibinc \
 // RUN:   %s 2>&1 \
-// RUN:   | FileCheck -check-prefix=CHECK006 %s
-// CHECK006: "-cc1"
-// CHECK006-NOT: "-internal-isystem" "{{.*}}/Inputs/hexagon_tree/qc/bin/../../gnu/hexagon/include/c++/4.4.0"
-// CHECK006-NEXT: "{{.*}}/Inputs/hexagon_tree/qc/bin/../../gnu/bin{{/|\\\\}}hexagon-as"
+// RUN:   | FileCheck -check-prefix=CHECK013 %s
+// CHECK013: "-cc1"
+// CHECK013-DAG-NOT: "-internal-isystem"
+// CHECK013-DAG-NOT: "-internal-externc-isystem"
 
 // -----------------------------------------------------------------------------
-// Test -march=<archname> -mcpu=<archname> -mv<number>
+// Test -mcpu=<cpuname> -mv<number>
 // -----------------------------------------------------------------------------
-// RUN: %clang -### -target hexagon-unknown-elf -fno-integrated-as    \
-// RUN:   -ccc-install-dir %S/Inputs/hexagon_tree/qc/bin \
-// RUN:   --gcc-toolchain="" \
-// RUN:   -march=hexagonv3 \
+// RUN: %clang -### -target hexagon-unknown-elf \
+// RUN:   -ccc-install-dir %S/Inputs/hexagon_tree/Tools/bin \
+// RUN:   -mcpu=hexagonv4 \
 // RUN:   %s 2>&1 \
-// RUN:   | FileCheck -check-prefix=CHECK007 %s
-// CHECK007: "-cc1" {{.*}} "-target-cpu" "hexagonv3"
-// CHECK007-NEXT: "{{.*}}/Inputs/hexagon_tree/qc/bin/../../gnu/bin{{/|\\\\}}hexagon-as"{{.*}} "-march=v3"
-// CHECK007-NEXT: "{{.*}}/Inputs/hexagon_tree/qc/bin/../../gnu/bin{{/|\\\\}}hexagon-ld"{{.*}} "-mv3"
+// RUN:   | FileCheck -check-prefix=CHECK020 %s
+// CHECK020: "-cc1" {{.*}} "-target-cpu" "hexagonv4"
+// CHECK020: "hexagon-link" {{.*}}/Inputs/hexagon_tree/Tools/bin/../target/hexagon/lib/v4/crt0
 
-// RUN: %clang -### -target hexagon-unknown-elf -fno-integrated-as    \
-// RUN:   -ccc-install-dir %S/Inputs/hexagon_tree/qc/bin \
-// RUN:   --gcc-toolchain="" \
+// RUN: %clang -### -target hexagon-unknown-elf \
+// RUN:   -ccc-install-dir %S/Inputs/hexagon_tree/Tools/bin \
 // RUN:   -mcpu=hexagonv5 \
 // RUN:   %s 2>&1 \
-// RUN:   | FileCheck -check-prefix=CHECK008 %s
-// CHECK008: "-cc1" {{.*}} "-target-cpu" "hexagonv5"
-// CHECK008-NEXT: "{{.*}}/Inputs/hexagon_tree/qc/bin/../../gnu/bin{{/|\\\\}}hexagon-as"{{.*}} "-march=v5"
-// CHECK008-NEXT: "{{.*}}/Inputs/hexagon_tree/qc/bin/../../gnu/bin{{/|\\\\}}hexagon-ld"{{.*}} "-mv5"
+// RUN:   | FileCheck -check-prefix=CHECK021 %s
+// CHECK021: "-cc1" {{.*}} "-target-cpu" "hexagonv5"
+// CHECK021: "hexagon-link" {{.*}}/Inputs/hexagon_tree/Tools/bin/../target/hexagon/lib/v5/crt0
 
-// RUN: %clang -### -target hexagon-unknown-elf -fno-integrated-as    \
-// RUN:   -ccc-install-dir %S/Inputs/hexagon_tree/qc/bin \
-// RUN:   --gcc-toolchain="" \
-// RUN:   -mv2 \
+// RUN: %clang -### -target hexagon-unknown-elf \
+// RUN:   -ccc-install-dir %S/Inputs/hexagon_tree/Tools/bin \
+// RUN:   -mcpu=hexagonv55 \
 // RUN:   %s 2>&1 \
-// RUN:   | FileCheck -check-prefix=CHECK009 %s
-// CHECK009: "-cc1" {{.*}} "-target-cpu" "hexagonv2"
-// CHECK009-NEXT: "{{.*}}/Inputs/hexagon_tree/qc/bin/../../gnu/bin{{/|\\\\}}hexagon-as"{{.*}} "-march=v2"
-// CHECK009-NEXT: "{{.*}}/Inputs/hexagon_tree/qc/bin/../../gnu/bin{{/|\\\\}}hexagon-ld"{{.*}} "-mv2"
+// RUN:   | FileCheck -check-prefix=CHECK022 %s
+// CHECK022: "-cc1" {{.*}} "-target-cpu" "hexagonv55"
+// CHECK022: "hexagon-link" {{.*}}/Inputs/hexagon_tree/Tools/bin/../target/hexagon/lib/v55/crt0
 
-// RUN: %clang -### -target hexagon-unknown-elf -fno-integrated-as    \
-// RUN:   -ccc-install-dir %S/Inputs/hexagon_tree/qc/bin \
-// RUN:   --gcc-toolchain="" \
+// RUN: %clang -### -target hexagon-unknown-elf \
+// RUN:   -ccc-install-dir %S/Inputs/hexagon_tree/Tools/bin \
+// RUN:   -mcpu=hexagonv60 \
 // RUN:   %s 2>&1 \
-// RUN:   | FileCheck -check-prefix=CHECK010 %s
-// CHECK010: "-cc1" {{.*}} "-target-cpu" "hexagonv4"
-// CHECK010-NEXT: "{{.*}}/Inputs/hexagon_tree/qc/bin/../../gnu/bin{{/|\\\\}}hexagon-as"{{.*}} "-march=v4"
-// CHECK010-NEXT: "{{.*}}/Inputs/hexagon_tree/qc/bin/../../gnu/bin{{/|\\\\}}hexagon-ld"{{.*}} "-mv4"
-
-// RUN: not %clang -march=hexagonv2 -target hexagon-unknown-elf \
-// RUN:   %s 2>&1 | FileCheck -check-prefix=CHECK-UNKNOWN-V2 %s
-// RUN: not %clang -mcpu=hexagonv2  -target hexagon-unknown-elf \
-// RUN:   %s 2>&1 | FileCheck -check-prefix=CHECK-UNKNOWN-V2 %s
-// RUN: not %clang -mv2             -target hexagon-unknown-elf \
-// RUN:   %s 2>&1 | FileCheck -check-prefix=CHECK-UNKNOWN-V2 %s
-// CHECK-UNKNOWN-V2: error: unknown target CPU 'hexagonv2'
-
-// RUN: not %clang -march=hexagonv3 -target hexagon-unknown-elf \
-// RUN:   %s 2>&1 | FileCheck -check-prefix=CHECK-UNKNOWN-V3 %s
-// RUN: not %clang -mcpu=hexagonv3  -target hexagon-unknown-elf \
-// RUN:   %s 2>&1 | FileCheck -check-prefix=CHECK-UNKNOWN-V3 %s
-// RUN: not %clang -mv3             -target hexagon-unknown-elf \
-// RUN:   %s 2>&1 | FileCheck -check-prefix=CHECK-UNKNOWN-V3 %s
-// CHECK-UNKNOWN-V3: error: unknown target CPU 'hexagonv3'
+// RUN:   | FileCheck -check-prefix=CHECK023 %s
+// CHECK023: "-cc1" {{.*}} "-target-cpu" "hexagonv60"
+// CHECK023: "hexagon-link" {{.*}}/Inputs/hexagon_tree/Tools/bin/../target/hexagon/lib/v60/crt0
 
 // -----------------------------------------------------------------------------
 // Test Linker related args
@@ -139,450 +96,388 @@
 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 // Defaults for C
 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-// RUN: %clang -### -target hexagon-unknown-elf -fno-integrated-as    \
-// RUN:   -ccc-install-dir %S/Inputs/hexagon_tree/qc/bin \
-// RUN:   --gcc-toolchain="" \
-// RUN:   %s 2>&1 \
-// RUN:   | FileCheck -check-prefix=CHECK011 %s
-// CHECK011: "-cc1"
-// CHECK011-NEXT: "{{.*}}/bin{{/|\\\\}}hexagon-as"{{.*}}
-// CHECK011-NEXT: "{{.*}}/bin{{/|\\\\}}hexagon-ld"
-// CHECK011-NOT: "-static"
-// CHECK011-NOT: "-shared"
-// CHECK011: "{{.*}}/hexagon/lib/v4/crt0_standalone.o"
-// CHECK011: "{{.*}}/hexagon/lib/v4/crt0.o"
-// CHECK011: "{{.*}}/hexagon/lib/v4/init.o"
-// CHECK011: "-L{{.*}}/lib/gcc/hexagon/4.4.0/v4"
-// CHECK011: "-L{{.*}}/lib/gcc/hexagon/4.4.0"
-// CHECK011: "-L{{.*}}/lib/gcc"
-// CHECK011: "-L{{.*}}/hexagon/lib/v4"
-// CHECK011: "-L{{.*}}/hexagon/lib"
-// CHECK011: "{{[^"]+}}.o"
-// CHECK011: "--start-group" "-lstandalone" "-lc" "-lgcc" "--end-group"
-// CHECK011: "{{.*}}/hexagon/lib/v4/fini.o"
+// RUN: %clang -### -target hexagon-unknown-elf \
+// RUN:   -ccc-install-dir %S/Inputs/hexagon_tree/Tools/bin \
+// RUN:   -mcpu=hexagonv60 \
+// RUN:   %s 2>&1 \
+// RUN:   | FileCheck -check-prefix=CHECK030 %s
+// CHECK030: "-cc1"
+// CHECK030-NEXT: hexagon-link
+// CHECK030-NOT: "-static"
+// CHECK030-NOT: "-shared"
+// CHECK030: "{{.*}}/Inputs/hexagon_tree/Tools/bin/../target/hexagon/lib/v60/crt0_standalone.o"
+// CHECK030: "{{.*}}/Inputs/hexagon_tree/Tools/bin/../target/hexagon/lib/v60/crt0.o"
+// CHECK030: "{{.*}}/Inputs/hexagon_tree/Tools/bin/../target/hexagon/lib/v60/init.o"
+// CHECK030: "-L{{.*}}/Inputs/hexagon_tree/Tools/bin/../target/hexagon/lib/v60"
+// CHECK030: "-L{{.*}}/Inputs/hexagon_tree/Tools/bin/../target/hexagon/lib"
+// CHECK030: "{{[^"]+}}.o"
+// CHECK030: "--start-group" "-lstandalone" "-lc" "-lgcc" "--end-group"
+// CHECK030: "{{.*}}/Inputs/hexagon_tree/Tools/bin/../target/hexagon/lib/v60/fini.o"
 
 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 // Defaults for C++
 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-// RUN: %clangxx -### -target hexagon-unknown-elf -fno-integrated-as    \
-// RUN:   -ccc-install-dir %S/Inputs/hexagon_tree/qc/bin \
-// RUN:   --gcc-toolchain="" \
-// RUN:   %s 2>&1 \
-// RUN:   | FileCheck -check-prefix=CHECK012 %s
-// CHECK012: "-cc1"
-// CHECK012-NEXT: "{{.*}}/bin{{/|\\\\}}hexagon-as"{{.*}}
-// CHECK012-NEXT: "{{.*}}/bin{{/|\\\\}}hexagon-ld"
-// CHECK012-NOT: "-static"
-// CHECK012-NOT: "-shared"
-// CHECK012: "{{.*}}/hexagon/lib/v4/crt0_standalone.o"
-// CHECK012: "{{.*}}/hexagon/lib/v4/crt0.o"
-// CHECK012: "{{.*}}/hexagon/lib/v4/init.o"
-// CHECK012: "-L{{.*}}/lib/gcc/hexagon/4.4.0/v4"
-// CHECK012: "-L{{.*}}/lib/gcc/hexagon/4.4.0"
-// CHECK012: "-L{{.*}}/lib/gcc"
-// CHECK012: "-L{{.*}}/hexagon/lib/v4"
-// CHECK012: "-L{{.*}}/hexagon/lib"
-// CHECK012: "{{[^"]+}}.o"
-// CHECK012: "-lstdc++" "-lm"
-// CHECK012: "--start-group" "-lstandalone" "-lc" "-lgcc" "--end-group"
-// CHECK012: "{{.*}}/hexagon/lib/v4/fini.o"
+// RUN: %clangxx -### -target hexagon-unknown-elf \
+// RUN:   -ccc-install-dir %S/Inputs/hexagon_tree/Tools/bin \
+// RUN:   -mcpu=hexagonv60 \
+// RUN:   %s 2>&1 \
+// RUN:   | FileCheck -check-prefix=CHECK031 %s
+// CHECK031: "-cc1"
+// CHECK031-NEXT: hexagon-link
+// CHECK031-NOT: "-static"
+// CHECK031-NOT: "-shared"
+// CHECK031: "{{.*}}/Inputs/hexagon_tree/Tools/bin/../target/hexagon/lib/v60/crt0_standalone.o"
+// CHECK031: "{{.*}}/Inputs/hexagon_tree/Tools/bin/../target/hexagon/lib/v60/crt0.o"
+// CHECK031: "{{.*}}/Inputs/hexagon_tree/Tools/bin/../target/hexagon/lib/v60/init.o"
+// CHECK031: "-L{{.*}}/Inputs/hexagon_tree/Tools/bin/../target/hexagon/lib/v60"
+// CHECK031: "-L{{.*}}/Inputs/hexagon_tree/Tools/bin/../target/hexagon/lib"
+// CHECK031: "{{[^"]+}}.o"
+// CHECK031: "-lstdc++" "-lm"
+// CHECK031: "--start-group" "-lstandalone" "-lc" "-lgcc" "--end-group"
+// CHECK031: "{{.*}}/Inputs/hexagon_tree/Tools/bin/../target/hexagon/lib/v60/fini.o"
 
 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 // Additional Libraries (-L)
 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-// RUN: %clang -### -target hexagon-unknown-elf -fno-integrated-as    \
-// RUN:   -ccc-install-dir %S/Inputs/hexagon_tree/qc/bin \
-// RUN:   --gcc-toolchain="" \
+// RUN: %clang -### -target hexagon-unknown-elf \
+// RUN:   -ccc-install-dir %S/Inputs/hexagon_tree/Tools/bin \
+// RUN:   -mcpu=hexagonv60 \
 // RUN:   -Lone -L two -L three \
 // RUN:   %s 2>&1 \
-// RUN:   | FileCheck -check-prefix=CHECK013 %s
-// CHECK013: "-cc1"
-// CHECK013-NEXT: "{{.*}}/bin{{/|\\\\}}hexagon-as"{{.*}}
-// CHECK013-NEXT: "{{.*}}/bin{{/|\\\\}}hexagon-ld"
-// CHECK013: "{{.*}}/hexagon/lib/v4/crt0_standalone.o"
-// CHECK013: "{{.*}}/hexagon/lib/v4/crt0.o"
-// CHECK013: "{{.*}}/hexagon/lib/v4/init.o"
-// CHECK013: "-Lone" "-Ltwo" "-Lthree"
-// CHECK013: "-L{{.*}}/lib/gcc/hexagon/4.4.0/v4"
-// CHECK013: "-L{{.*}}/lib/gcc/hexagon/4.4.0"
-// CHECK013: "-L{{.*}}/lib/gcc"
-// CHECK013: "-L{{.*}}/hexagon/lib/v4"
-// CHECK013: "-L{{.*}}/hexagon/lib"
-// CHECK013: "{{[^"]+}}.o"
-// CHECK013: "--start-group" "-lstandalone" "-lc" "-lgcc" "--end-group"
-// CHECK013: "{{.*}}/hexagon/lib/v4/fini.o"
+// RUN:   | FileCheck -check-prefix=CHECK032 %s
+// CHECK032: "-cc1"
+// CHECK032-NEXT: hexagon-link
+// CHECK032-NOT: "-static"
+// CHECK032-NOT: "-shared"
+// CHECK032: "{{.*}}/Inputs/hexagon_tree/Tools/bin/../target/hexagon/lib/v60/crt0_standalone.o"
+// CHECK032: "{{.*}}/Inputs/hexagon_tree/Tools/bin/../target/hexagon/lib/v60/crt0.o"
+// CHECK032: "{{.*}}/Inputs/hexagon_tree/Tools/bin/../target/hexagon/lib/v60/init.o"
+// CHECK032: "-Lone" "-Ltwo" "-Lthree"
+// CHECK032: "-L{{.*}}/Inputs/hexagon_tree/Tools/bin/../target/hexagon/lib/v60"
+// CHECK032: "-L{{.*}}/Inputs/hexagon_tree/Tools/bin/../target/hexagon/lib"
+// CHECK032: "{{[^"]+}}.o"
+// CHECK032: "--start-group" "-lstandalone" "-lc" "-lgcc" "--end-group"
+// CHECK032: "{{.*}}/Inputs/hexagon_tree/Tools/bin/../target/hexagon/lib/v60/fini.o"
 
 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 // -static, -shared
 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-// RUN: %clang -### -target hexagon-unknown-elf -fno-integrated-as    \
-// RUN:   -ccc-install-dir %S/Inputs/hexagon_tree/qc/bin \
-// RUN:   --gcc-toolchain="" \
+// RUN: %clang -### -target hexagon-unknown-elf \
+// RUN:   -ccc-install-dir %S/Inputs/hexagon_tree/Tools/bin \
+// RUN:   -mcpu=hexagonv60 \
 // RUN:   -static \
 // RUN:   %s 2>&1 \
-// RUN:   | FileCheck -check-prefix=CHECK014 %s
-// CHECK014: "-cc1"
-// CHECK014-NEXT: "{{.*}}/bin{{/|\\\\}}hexagon-as"{{.*}}
-// CHECK014-NEXT: "{{.*}}/bin{{/|\\\\}}hexagon-ld"
-// CHECK014: "-static"
-// CHECK014: "{{.*}}/hexagon/lib/v4/crt0_standalone.o"
-// CHECK014: "{{.*}}/hexagon/lib/v4/crt0.o"
-// CHECK014: "{{.*}}/hexagon/lib/v4/init.o"
-// CHECK014: "-L{{.*}}/lib/gcc/hexagon/4.4.0/v4"
-// CHECK014: "-L{{.*}}/lib/gcc/hexagon/4.4.0"
-// CHECK014: "-L{{.*}}/lib/gcc"
-// CHECK014: "-L{{.*}}/hexagon/lib/v4"
-// CHECK014: "-L{{.*}}/hexagon/lib"
-// CHECK014: "{{[^"]+}}.o"
-// CHECK014: "--start-group" "-lstandalone" "-lc" "-lgcc" "--end-group"
-// CHECK014: "{{.*}}/hexagon/lib/v4/fini.o"
-
-// RUN: %clang -### -target hexagon-unknown-elf -fno-integrated-as    \
-// RUN:   -ccc-install-dir %S/Inputs/hexagon_tree/qc/bin \
-// RUN:   --gcc-toolchain="" \
+// RUN:   | FileCheck -check-prefix=CHECK033 %s
+// CHECK033: "-cc1"
+// CHECK033-NEXT: hexagon-link
+// CHECK033: "-static"
+// CHECK033: "{{.*}}/Inputs/hexagon_tree/Tools/bin/../target/hexagon/lib/v60/crt0_standalone.o"
+// CHECK033: "{{.*}}/Inputs/hexagon_tree/Tools/bin/../target/hexagon/lib/v60/crt0.o"
+// CHECK033: "{{.*}}/Inputs/hexagon_tree/Tools/bin/../target/hexagon/lib/v60/init.o"
+// CHECK033: "-L{{.*}}/Inputs/hexagon_tree/Tools/bin/../target/hexagon/lib/v60"
+// CHECK033: "-L{{.*}}/Inputs/hexagon_tree/Tools/bin/../target/hexagon/lib"
+// CHECK033: "{{[^"]+}}.o"
+// CHECK033: "--start-group" "-lstandalone" "-lc" "-lgcc" "--end-group"
+// CHECK033: "{{.*}}/Inputs/hexagon_tree/Tools/bin/../target/hexagon/lib/v60/fini.o"
+
+// RUN: %clang -### -target hexagon-unknown-elf \
+// RUN:   -ccc-install-dir %S/Inputs/hexagon_tree/Tools/bin \
+// RUN:   -mcpu=hexagonv60 \
 // RUN:   -shared \
 // RUN:   %s 2>&1 \
-// RUN:   | FileCheck -check-prefix=CHECK015 %s
-// CHECK015: "-cc1"
-// CHECK015-NEXT: "{{.*}}/bin{{/|\\\\}}hexagon-as"{{.*}}
-// CHECK015-NEXT: "{{.*}}/bin{{/|\\\\}}hexagon-ld"
-// CHECK015: "-shared" "-call_shared"
-// CHECK015-NOT: crt0_standalone.o
-// CHECK015-NOT: crt0.o
-// CHECK015: "{{.*}}/hexagon/lib/v4/G0/initS.o"
-// CHECK015: "-L{{.*}}/lib/gcc/hexagon/4.4.0/v4/G0"
-// CHECK015: "-L{{.*}}/lib/gcc/hexagon/4.4.0/G0"
-// CHECK015: "-L{{.*}}/lib/gcc/hexagon/4.4.0/v4"
-// CHECK015: "-L{{.*}}/lib/gcc/hexagon/4.4.0"
-// CHECK015: "-L{{.*}}/lib/gcc"
-// CHECK015: "-L{{.*}}/hexagon/lib/v4/G0"
-// CHECK015: "-L{{.*}}/hexagon/lib/G0"
-// CHECK015: "-L{{.*}}/hexagon/lib/v4"
-// CHECK015: "-L{{.*}}/hexagon/lib"
-// CHECK015: "{{[^"]+}}.o"
-// CHECK015: "--start-group"
-// CHECK015-NOT: "-lstandalone"
-// CHECK015-NOT: "-lc"
-// CHECK015: "-lgcc"
-// CHECK015: "--end-group"
-// CHECK015: "{{.*}}/hexagon/lib/v4/G0/finiS.o"
-
-// RUN: %clang -### -target hexagon-unknown-elf -fno-integrated-as    \
-// RUN:   -ccc-install-dir %S/Inputs/hexagon_tree/qc/bin \
-// RUN:   --gcc-toolchain="" \
+// RUN:   | FileCheck -check-prefix=CHECK034 %s
+// CHECK034: "-cc1"
+// CHECK034-NEXT: hexagon-link
+// CHECK034: "-shared" "-call_shared"
+// CHECK034-NOT: crt0_standalone.o
+// CHECK034-NOT: crt0.o
+// CHECK034: "{{.*}}/Inputs/hexagon_tree/Tools/bin/../target/hexagon/lib/v60/G0/pic/initS.o"
+// CHECK034: "-L{{.*}}/Inputs/hexagon_tree/Tools/bin/../target/hexagon/lib/v60/G0"
+// CHECK034: "-L{{.*}}/Inputs/hexagon_tree/Tools/bin/../target/hexagon/lib/v60"
+// CHECK034: "-L{{.*}}/Inputs/hexagon_tree/Tools/bin/../target/hexagon/lib"
+// CHECK034: "{{[^"]+}}.o"
+// CHECK034: "--start-group"
+// CHECK034-NOT: "-lstandalone"
+// CHECK034-NOT: "-lc"
+// CHECK034: "-lgcc"
+// CHECK034: "--end-group"
+// CHECK034: "{{.*}}/Inputs/hexagon_tree/Tools/bin/../target/hexagon/lib/v60/G0/pic/finiS.o"
+
+// RUN: %clang -### -target hexagon-unknown-elf \
+// RUN:   -ccc-install-dir %S/Inputs/hexagon_tree/Tools/bin \
+// RUN:   -mcpu=hexagonv60 \
 // RUN:   -shared \
 // RUN:   -static \
 // RUN:   %s 2>&1 \
-// RUN:   | FileCheck -check-prefix=CHECK016 %s
-// CHECK016: "-cc1"
-// CHECK016-NEXT: "{{.*}}/bin{{/|\\\\}}hexagon-as"{{.*}}
-// CHECK016-NEXT: "{{.*}}/bin{{/|\\\\}}hexagon-ld"
-// CHECK016: "-shared" "-call_shared" "-static"
-// CHECK016-NOT: crt0_standalone.o
-// CHECK016-NOT: crt0.o
-// CHECK016: "{{.*}}/hexagon/lib/v4/G0/init.o"
-// CHECK016: "-L{{.*}}/lib/gcc/hexagon/4.4.0/v4/G0"
-// CHECK016: "-L{{.*}}/lib/gcc/hexagon/4.4.0/G0"
-// CHECK016: "-L{{.*}}/lib/gcc/hexagon/4.4.0/v4"
-// CHECK016: "-L{{.*}}/lib/gcc/hexagon/4.4.0"
-// CHECK016: "-L{{.*}}/lib/gcc"
-// CHECK016: "-L{{.*}}/hexagon/lib/v4/G0"
-// CHECK016: "-L{{.*}}/hexagon/lib/G0"
-// CHECK016: "-L{{.*}}/hexagon/lib/v4"
-// CHECK016: "-L{{.*}}/hexagon/lib"
-// CHECK016: "{{[^"]+}}.o"
-// CHECK016: "--start-group"
-// CHECK016-NOT: "-lstandalone"
-// CHECK016-NOT: "-lc"
-// CHECK016: "-lgcc"
-// CHECK016: "--end-group"
-// CHECK016: "{{.*}}/hexagon/lib/v4/G0/fini.o"
+// RUN:   | FileCheck -check-prefix=CHECK035 %s
+// CHECK035: "-cc1"
+// CHECK035-NEXT: hexagon-link
+// CHECK035: "-shared" "-call_shared" "-static"
+// CHECK035-NOT: crt0_standalone.o
+// CHECK035-NOT: crt0.o
+// CHECK035: "{{.*}}/Inputs/hexagon_tree/Tools/bin/../target/hexagon/lib/v60/G0/init.o"
+// CHECK035: "-L{{.*}}/Inputs/hexagon_tree/Tools/bin/../target/hexagon/lib/v60/G0"
+// CHECK035: "-L{{.*}}/Inputs/hexagon_tree/Tools/bin/../target/hexagon/lib/v60"
+// CHECK035: "-L{{.*}}/Inputs/hexagon_tree/Tools/bin/../target/hexagon/lib"
+// CHECK035: "{{[^"]+}}.o"
+// CHECK035: "--start-group"
+// CHECK035-NOT: "-lstandalone"
+// CHECK035-NOT: "-lc"
+// CHECK035: "-lgcc"
+// CHECK035: "--end-group"
+// CHECK035: "{{.*}}/Inputs/hexagon_tree/Tools/bin/../target/hexagon/lib/v60/G0/fini.o"
 
 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 // -nostdlib, -nostartfiles, -nodefaultlibs
 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-// RUN: %clangxx -### -target hexagon-unknown-elf -fno-integrated-as    \
-// RUN:   -ccc-install-dir %S/Inputs/hexagon_tree/qc/bin \
-// RUN:   --gcc-toolchain="" \
+// RUN: %clangxx -### -target hexagon-unknown-elf \
+// RUN:   -ccc-install-dir %S/Inputs/hexagon_tree/Tools/bin \
+// RUN:   -mcpu=hexagonv60 \
 // RUN:   -nostdlib \
 // RUN:   %s 2>&1 \
-// RUN:   | FileCheck -check-prefix=CHECK017 %s
-// CHECK017: "-cc1"
-// CHECK017-NEXT: "{{.*}}/bin{{/|\\\\}}hexagon-as"{{.*}}
-// CHECK017-NEXT: "{{.*}}/bin{{/|\\\\}}hexagon-ld"
-// CHECK017-NOT: crt0_standalone.o
-// CHECK017-NOT: crt0.o
-// CHECK017-NOT: init.o
-// CHECK017: "-L{{.*}}/lib/gcc/hexagon/4.4.0/v4"
-// CHECK017: "-L{{.*}}/lib/gcc/hexagon/4.4.0"
-// CHECK017: "-L{{.*}}/lib/gcc"
-// CHECK017: "-L{{.*}}/hexagon/lib/v4"
-// CHECK017: "-L{{.*}}/hexagon/lib"
-// CHECK017: "{{[^"]+}}.o"
-// CHECK017-NOT: "-lstdc++"
-// CHECK017-NOT: "-lm"
-// CHECK017-NOT: "--start-group"
-// CHECK017-NOT: "-lstandalone"
-// CHECK017-NOT: "-lc"
-// CHECK017-NOT: "-lgcc"
-// CHECK017-NOT: "--end-group"
-// CHECK017-NOT: fini.o
-
-// RUN: %clangxx -### -target hexagon-unknown-elf -fno-integrated-as    \
-// RUN:   -ccc-install-dir %S/Inputs/hexagon_tree/qc/bin \
-// RUN:   --gcc-toolchain="" \
+// RUN:   | FileCheck -check-prefix=CHECK036 %s
+// CHECK036: "-cc1"
+// CHECK036-NEXT: hexagon-link
+// CHECK036-NOT: crt0_standalone.o
+// CHECK036-NOT: crt0.o
+// CHECK036-NOT: init.o
+// CHECK036: "-L{{.*}}/Inputs/hexagon_tree/Tools/bin/../target/hexagon/lib/v60"
+// CHECK036: "-L{{.*}}/Inputs/hexagon_tree/Tools/bin/../target/hexagon/lib"
+// CHECK036: "{{[^"]+}}.o"
+// CHECK036-NOT: "-lstdc++"
+// CHECK036-NOT: "-lm"
+// CHECK036-NOT: "--start-group"
+// CHECK036-NOT: "-lstandalone"
+// CHECK036-NOT: "-lc"
+// CHECK036-NOT: "-lgcc"
+// CHECK036-NOT: "--end-group"
+// CHECK036-NOT: fini.o
+
+// RUN: %clangxx -### -target hexagon-unknown-elf \
+// RUN:   -ccc-install-dir %S/Inputs/hexagon_tree/Tools/bin \
+// RUN:   -mcpu=hexagonv60 \
 // RUN:   -nostartfiles \
 // RUN:   %s 2>&1 \
-// RUN:   | FileCheck -check-prefix=CHECK018 %s
-// CHECK018: "-cc1"
-// CHECK018-NEXT: "{{.*}}/bin{{/|\\\\}}hexagon-as"{{.*}}
-// CHECK018-NEXT: "{{.*}}/bin{{/|\\\\}}hexagon-ld"
-// CHECK018-NOT: crt0_standalone.o
-// CHECK018-NOT: crt0.o
-// CHECK018-NOT: init.o
-// CHECK018: "-L{{.*}}/lib/gcc/hexagon/4.4.0/v4"
-// CHECK018: "-L{{.*}}/lib/gcc/hexagon/4.4.0"
-// CHECK018: "-L{{.*}}/lib/gcc"
-// CHECK018: "-L{{.*}}/hexagon/lib/v4"
-// CHECK018: "-L{{.*}}/hexagon/lib"
-// CHECK018: "{{[^"]+}}.o"
-// CHECK018: "-lstdc++"
-// CHECK018: "-lm"
-// CHECK018: "--start-group"
-// CHECK018: "-lstandalone"
-// CHECK018: "-lc"
-// CHECK018: "-lgcc"
-// CHECK018: "--end-group"
-// CHECK018-NOT: fini.o
-
-// RUN: %clangxx -### -target hexagon-unknown-elf -fno-integrated-as    \
-// RUN:   -ccc-install-dir %S/Inputs/hexagon_tree/qc/bin \
-// RUN:   --gcc-toolchain="" \
+// RUN:   | FileCheck -check-prefix=CHECK037 %s
+// CHECK037: "-cc1"
+// CHECK037-NEXT: hexagon-link
+// CHECK037-NOT: crt0_standalone.o
+// CHECK037-NOT: crt0.o
+// CHECK037-NOT: init.o
+// CHECK037: "-L{{.*}}/Inputs/hexagon_tree/Tools/bin/../target/hexagon/lib/v60"
+// CHECK037: "-L{{.*}}/Inputs/hexagon_tree/Tools/bin/../target/hexagon/lib"
+// CHECK037: "{{[^"]+}}.o"
+// CHECK037: "-lstdc++"
+// CHECK037: "-lm"
+// CHECK037: "--start-group"
+// CHECK037: "-lstandalone"
+// CHECK037: "-lc"
+// CHECK037: "-lgcc"
+// CHECK037: "--end-group"
+// CHECK037-NOT: fini.o
+
+// RUN: %clangxx -### -target hexagon-unknown-elf \
+// RUN:   -ccc-install-dir %S/Inputs/hexagon_tree/Tools/bin \
+// RUN:   -mcpu=hexagonv60 \
 // RUN:   -nodefaultlibs \
 // RUN:   %s 2>&1 \
-// RUN:   | FileCheck -check-prefix=CHECK019 %s
-// CHECK019: "-cc1"
-// CHECK019-NEXT: "{{.*}}/bin{{/|\\\\}}hexagon-as"{{.*}}
-// CHECK019-NEXT: "{{.*}}/bin{{/|\\\\}}hexagon-ld"
-// CHECK019: "{{.*}}/hexagon/lib/v4/crt0_standalone.o"
-// CHECK019: "{{.*}}/hexagon/lib/v4/crt0.o"
-// CHECK019: "{{.*}}/hexagon/lib/v4/init.o"
-// CHECK019: "-L{{.*}}/lib/gcc/hexagon/4.4.0/v4"
-// CHECK019: "-L{{.*}}/lib/gcc/hexagon/4.4.0"
-// CHECK019: "-L{{.*}}/lib/gcc"
-// CHECK019: "-L{{.*}}/hexagon/lib/v4"
-// CHECK019: "-L{{.*}}/hexagon/lib"
-// CHECK019: "{{[^"]+}}.o"
-// CHECK019-NOT: "-lstdc++"
-// CHECK019-NOT: "-lm"
-// CHECK019-NOT: "--start-group"
-// CHECK019-NOT: "-lstandalone"
-// CHECK019-NOT: "-lc"
-// CHECK019-NOT: "-lgcc"
-// CHECK019-NOT: "--end-group"
-// CHECK019: "{{.*}}/hexagon/lib/v4/fini.o"
+// RUN:   | FileCheck -check-prefix=CHECK038 %s
+// CHECK038: "-cc1"
+// CHECK038-NEXT: hexagon-link
+// CHECK038: "{{.*}}/Inputs/hexagon_tree/Tools/bin/../target/hexagon/lib/v60/crt0_standalone.o"
+// CHECK038: "{{.*}}/Inputs/hexagon_tree/Tools/bin/../target/hexagon/lib/v60/crt0.o"
+// CHECK038: "{{.*}}/Inputs/hexagon_tree/Tools/bin/../target/hexagon/lib/v60/init.o"
+// CHECK038: "-L{{.*}}/Inputs/hexagon_tree/Tools/bin/../target/hexagon/lib/v60"
+// CHECK038: "-L{{.*}}/Inputs/hexagon_tree/Tools/bin/../target/hexagon/lib"
+// CHECK038: "{{[^"]+}}.o"
+// CHECK038-NOT: "-lstdc++"
+// CHECK038-NOT: "-lm"
+// CHECK038-NOT: "--start-group"
+// CHECK038-NOT: "-lstandalone"
+// CHECK038-NOT: "-lc"
+// CHECK038-NOT: "-lgcc"
+// CHECK038-NOT: "--end-group"
+// CHECK038: "{{.*}}/Inputs/hexagon_tree/Tools/bin/../target/hexagon/lib/v60/fini.o"
 
 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 // -moslib
 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-// RUN: %clang -### -target hexagon-unknown-elf -fno-integrated-as    \
-// RUN:   -ccc-install-dir %S/Inputs/hexagon_tree/qc/bin \
-// RUN:   --gcc-toolchain="" \
+// RUN: %clang -### -target hexagon-unknown-elf \
+// RUN:   -ccc-install-dir %S/Inputs/hexagon_tree/Tools/bin \
+// RUN:   -mcpu=hexagonv60 \
 // RUN:   -moslib=first -moslib=second \
 // RUN:   %s 2>&1 \
-// RUN:   | FileCheck -check-prefix=CHECK020 %s
-// CHECK020: "-cc1"
-// CHECK020-NEXT: "{{.*}}/bin{{/|\\\\}}hexagon-as"{{.*}}
-// CHECK020-NEXT: "{{.*}}/bin{{/|\\\\}}hexagon-ld"
-// CHECK020-NOT: "-static"
-// CHECK020-NOT: "-shared"
-// CHECK020-NOT: crt0_standalone.o
-// CHECK020: "{{.*}}/hexagon/lib/v4/crt0.o"
-// CHECK020: "{{.*}}/hexagon/lib/v4/init.o"
-// CHECK020: "-L{{.*}}/lib/gcc/hexagon/4.4.0/v4"
-// CHECK020: "-L{{.*}}/lib/gcc/hexagon/4.4.0"
-// CHECK020: "-L{{.*}}/lib/gcc"
-// CHECK020: "-L{{.*}}/hexagon/lib/v4"
-// CHECK020: "-L{{.*}}/hexagon/lib"
-// CHECK020: "{{[^"]+}}.o"
-// CHECK020: "--start-group"
-// CHECK020: "-lfirst" "-lsecond"
-// CHECK020-NOT: "-lstandalone"
-// CHECK020: "-lc" "-lgcc" "--end-group"
-// CHECK020: "{{.*}}/hexagon/lib/v4/fini.o"
-
-// RUN: %clang -### -target hexagon-unknown-elf -fno-integrated-as    \
-// RUN:   -ccc-install-dir %S/Inputs/hexagon_tree/qc/bin \
-// RUN:   --gcc-toolchain="" \
-// RUN:   -moslib=first -moslib=second -moslib=standalone\
-// RUN:   %s 2>&1 \
-// RUN:   | FileCheck -check-prefix=CHECK021 %s
-// CHECK021: "-cc1"
-// CHECK021-NEXT: "{{.*}}/bin{{/|\\\\}}hexagon-as"{{.*}}
-// CHECK021-NEXT: "{{.*}}/bin{{/|\\\\}}hexagon-ld"
-// CHECK021-NOT: "-static"
-// CHECK021-NOT: "-shared"
-// CHECK021: "{{.*}}/hexagon/lib/v4/crt0_standalone.o"
-// CHECK021: "{{.*}}/hexagon/lib/v4/crt0.o"
-// CHECK021: "{{.*}}/hexagon/lib/v4/init.o"
-// CHECK021: "-L{{.*}}/lib/gcc/hexagon/4.4.0/v4"
-// CHECK021: "-L{{.*}}/lib/gcc/hexagon/4.4.0"
-// CHECK021: "-L{{.*}}/lib/gcc"
-// CHECK021: "-L{{.*}}/hexagon/lib/v4"
-// CHECK021: "-L{{.*}}/hexagon/lib"
-// CHECK021: "{{[^"]+}}.o"
-// CHECK021: "--start-group"
-// CHECK021: "-lfirst" "-lsecond"
-// CHECK021: "-lstandalone"
-// CHECK021: "-lc" "-lgcc" "--end-group"
-// CHECK021: "{{.*}}/hexagon/lib/v4/fini.o"
+// RUN:   | FileCheck -check-prefix=CHECK039 %s
+// CHECK039: "-cc1"
+// CHECK039-NEXT: hexagon-link
+// CHECK039-NOT: "-static"
+// CHECK039-NOT: "-shared"
+// CHECK039-NOT: crt0_standalone.o
+// CHECK039: "{{.*}}/Inputs/hexagon_tree/Tools/bin/../target/hexagon/lib/v60/crt0.o"
+// CHECK039: "{{.*}}/Inputs/hexagon_tree/Tools/bin/../target/hexagon/lib/v60/init.o"
+// CHECK039: "-L{{.*}}/Inputs/hexagon_tree/Tools/bin/../target/hexagon/lib/v60"
+// CHECK039: "-L{{.*}}/Inputs/hexagon_tree/Tools/bin/../target/hexagon/lib"
+// CHECK039: "{{[^"]+}}.o"
+// CHECK039: "--start-group"
+// CHECK039: "-lfirst" "-lsecond"
+// CHECK039-NOT: "-lstandalone"
+// CHECK039: "-lc" "-lgcc" "--end-group"
+// CHECK039: "{{.*}}/Inputs/hexagon_tree/Tools/bin/../target/hexagon/lib/v60/fini.o"
+
+// RUN: %clang -### -target hexagon-unknown-elf \
+// RUN:   -ccc-install-dir %S/Inputs/hexagon_tree/Tools/bin \
+// RUN:   -mcpu=hexagonv60 \
+// RUN:   -moslib=first -moslib=second -moslib=standalone \
+// RUN:   %s 2>&1 \
+// RUN:   | FileCheck -check-prefix=CHECK03A %s
+// CHECK03A: "-cc1"
+// CHECK03A-NEXT: hexagon-link
+// CHECK03A-NOT: "-static"
+// CHECK03A-NOT: "-shared"
+// CHECK03A: "{{.*}}/Inputs/hexagon_tree/Tools/bin/../target/hexagon/lib/v60/crt0_standalone.o"
+// CHECK03A: "{{.*}}/Inputs/hexagon_tree/Tools/bin/../target/hexagon/lib/v60/crt0.o"
+// CHECK03A: "{{.*}}/Inputs/hexagon_tree/Tools/bin/../target/hexagon/lib/v60/init.o"
+// CHECK03A: "-L{{.*}}/Inputs/hexagon_tree/Tools/bin/../target/hexagon/lib/v60"
+// CHECK03A: "-L{{.*}}/Inputs/hexagon_tree/Tools/bin/../target/hexagon/lib"
+// CHECK03A: "{{[^"]+}}.o"
+// CHECK03A: "--start-group"
+// CHECK03A: "-lfirst" "-lsecond"
+// CHECK03A: "-lstandalone"
+// CHECK03A: "-lc" "-lgcc" "--end-group"
+// CHECK03A: "{{.*}}/Inputs/hexagon_tree/Tools/bin/../target/hexagon/lib/v60/fini.o"
 
 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 // Other args to pass to linker
 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-// RUN: %clangxx -### -target hexagon-unknown-elf -fno-integrated-as    \
-// RUN:   -ccc-install-dir %S/Inputs/hexagon_tree/qc/bin \
-// RUN:   --gcc-toolchain="" \
+// RUN: %clangxx -### -target hexagon-unknown-elf \
+// RUN:   -ccc-install-dir %S/Inputs/hexagon_tree/Tools/bin \
+// RUN:   -mcpu=hexagonv60 \
 // RUN:   -s \
 // RUN:   -Tbss 0xdead -Tdata 0xbeef -Ttext 0xcafe \
 // RUN:   -t \
 // RUN:   -e start_here \
 // RUN:   -uFoo -undefined Bar \
 // RUN:   %s 2>&1 \
-// RUN:   | FileCheck -check-prefix=CHECK022 %s
-// CHECK022: "-cc1"
-// CHECK022-NEXT: "{{.*}}/bin{{/|\\\\}}hexagon-as"{{.*}}
-// CHECK022-NEXT: "{{.*}}/bin{{/|\\\\}}hexagon-ld"
-// CHECK022: "{{.*}}/hexagon/lib/v4/crt0_standalone.o"
-// CHECK022: "{{.*}}/hexagon/lib/v4/crt0.o"
-// CHECK022: "{{.*}}/hexagon/lib/v4/init.o"
-// CHECK022: "-L{{.*}}/lib/gcc/hexagon/4.4.0/v4"
-// CHECK022: "-L{{.*}}/lib/gcc/hexagon/4.4.0"
-// CHECK022: "-L{{.*}}/lib/gcc"
-// CHECK022: "-L{{.*}}/hexagon/lib/v4"
-// CHECK022: "-L{{.*}}/hexagon/lib"
-// CHECK022: "-s"
-// CHECK022: "-Tbss" "0xdead" "-Tdata" "0xbeef" "-Ttext" "0xcafe"
-// CHECK022: "-t"
-// CHECK022: "-u" "Foo" "-undefined" "Bar"
-// CHECK022: "{{[^"]+}}.o"
-// CHECK022: "-lstdc++" "-lm"
-// CHECK022: "--start-group" "-lstandalone" "-lc" "-lgcc" "--end-group"
-// CHECK022: "{{.*}}/hexagon/lib/v4/fini.o"
+// RUN:   | FileCheck -check-prefix=CHECK03B %s
+// CHECK03B: "-cc1"
+// CHECK03B-NEXT: hexagon-link
+// CHECK03B: "{{.*}}/Inputs/hexagon_tree/Tools/bin/../target/hexagon/lib/v60/crt0_standalone.o"
+// CHECK03B: "{{.*}}/Inputs/hexagon_tree/Tools/bin/../target/hexagon/lib/v60/crt0.o"
+// CHECK03B: "{{.*}}/Inputs/hexagon_tree/Tools/bin/../target/hexagon/lib/v60/init.o"
+// CHECK03B: "-L{{.*}}/Inputs/hexagon_tree/Tools/bin/../target/hexagon/lib/v60"
+// CHECK03B: "-L{{.*}}/Inputs/hexagon_tree/Tools/bin/../target/hexagon/lib"
+// CHECK03B: "-s"
+// CHECK03B: "-Tbss" "0xdead" "-Tdata" "0xbeef" "-Ttext" "0xcafe"
+// CHECK03B: "-t"
+// CHECK03B: "-u" "Foo" "-undefined" "Bar"
+// CHECK03B: "{{[^"]+}}.o"
+// CHECK03B: "-lstdc++" "-lm"
+// CHECK03B: "--start-group" "-lstandalone" "-lc" "-lgcc" "--end-group"
+// CHECK03B: "{{.*}}/Inputs/hexagon_tree/Tools/bin/../target/hexagon/lib/v60/fini.o"
 
 // -----------------------------------------------------------------------------
 // pic, small data threshold
 // -----------------------------------------------------------------------------
-// RUN: %clang -### -target hexagon-unknown-elf -fno-integrated-as    \
-// RUN:   -ccc-install-dir %S/Inputs/hexagon_tree/qc/bin \
-// RUN:   --gcc-toolchain="" \
-// RUN:   %s 2>&1 \
-// RUN:   | FileCheck -check-prefix=CHECK023 %s
-// CHECK023:      "-cc1"
-// CHECK023:        "-mrelocation-model" "static"
-// CHECK023-NEXT: "{{.*}}/bin{{/|\\\\}}hexagon-as"
-// CHECK023-NOT:    "-G{{[0-9]+}}"
-// CHECK023-NEXT: "{{.*}}/bin{{/|\\\\}}hexagon-ld"
-// CHECK023-NOT:    "-G{{[0-9]+}}"
-
-// RUN: %clang -### -target hexagon-unknown-elf -fno-integrated-as    \
-// RUN:   -ccc-install-dir %S/Inputs/hexagon_tree/qc/bin \
-// RUN:   --gcc-toolchain="" \
+// RUN: %clang -### -target hexagon-unknown-elf \
+// RUN:   -ccc-install-dir %S/Inputs/hexagon_tree/Tools/bin \
+// RUN:   -mcpu=hexagonv60 \
+// RUN:   %s 2>&1 \
+// RUN:   | FileCheck -check-prefix=CHECK040 %s
+// CHECK040:      "-cc1"
+// CHECK040-NEXT: hexagon-link
+// CHECK040-NOT:  "-G{{[0-9]+}}"
+
+// RUN: %clang -### -target hexagon-unknown-elf \
+// RUN:   -ccc-install-dir %S/Inputs/hexagon_tree/Tools/bin \
+// RUN:   -mcpu=hexagonv60 \
 // RUN:   -fpic \
 // RUN:   %s 2>&1 \
-// RUN:   | FileCheck -check-prefix=CHECK024 %s
-// RUN: %clang -### -target hexagon-unknown-elf -fno-integrated-as    \
-// RUN:   -ccc-install-dir %S/Inputs/hexagon_tree/qc/bin \
-// RUN:   --gcc-toolchain="" \
+// RUN:   | FileCheck -check-prefix=CHECK041 %s
+// RUN: %clang -### -target hexagon-unknown-elf \
+// RUN:   -ccc-install-dir %S/Inputs/hexagon_tree/Tools/bin \
+// RUN:   -mcpu=hexagonv60 \
 // RUN:   -fPIC \
 // RUN:   %s 2>&1 \
-// RUN:   | FileCheck -check-prefix=CHECK024 %s
-// CHECK024:      "-cc1"
-// CHECK024-NOT:    "-mrelocation-model" "static"
-// CHECK024:        "-pic-level" "{{[12]}}"
-// CHECK024:        "-mllvm" "-hexagon-small-data-threshold=0"
-// CHECK024-NEXT: "{{.*}}/bin{{/|\\\\}}hexagon-as"
-// CHECK024:        "-G0"
-// CHECK024-NEXT: "{{.*}}/bin{{/|\\\\}}hexagon-ld"
-// CHECK024:        "-G0"
-
-// RUN: %clang -### -target hexagon-unknown-elf -fno-integrated-as    \
-// RUN:   -ccc-install-dir %S/Inputs/hexagon_tree/qc/bin \
-// RUN:   --gcc-toolchain="" \
+// RUN:   | FileCheck -check-prefix=CHECK041 %s
+// CHECK041:      "-cc1"
+// CHECK041-NOT:  "-mrelocation-model" "static"
+// CHECK041:      "-pic-level" "{{[12]}}"
+// CHECK041:      "-mllvm" "-hexagon-small-data-threshold=0"
+// CHECK041-NEXT: hexagon-link
+// CHECK041:      "-G0"
+
+// RUN: %clang -### -target hexagon-unknown-elf -fno-integrated-as \
+// RUN:   -ccc-install-dir %S/Inputs/hexagon_tree/Tools/bin \
+// RUN:   -mcpu=hexagonv60 \
 // RUN:   -G=8 \
 // RUN:   %s 2>&1 \
-// RUN:   | FileCheck -check-prefix=CHECK025 %s
-// RUN: %clang -### -target hexagon-unknown-elf -fno-integrated-as    \
-// RUN:   -ccc-install-dir %S/Inputs/hexagon_tree/qc/bin \
-// RUN:   --gcc-toolchain="" \
+// RUN:   | FileCheck -check-prefix=CHECK042 %s
+// RUN: %clang -### -target hexagon-unknown-elf -fno-integrated-as \
+// RUN:   -ccc-install-dir %S/Inputs/hexagon_tree/Tools/bin \
+// RUN:   -mcpu=hexagonv60 \
 // RUN:   -G 8 \
 // RUN:   %s 2>&1 \
-// RUN:   | FileCheck -check-prefix=CHECK025 %s
-// RUN: %clang -### -target hexagon-unknown-elf -fno-integrated-as    \
-// RUN:   -ccc-install-dir %S/Inputs/hexagon_tree/qc/bin \
-// RUN:   --gcc-toolchain="" \
+// RUN:   | FileCheck -check-prefix=CHECK042 %s
+// RUN: %clang -### -target hexagon-unknown-elf -fno-integrated-as \
+// RUN:   -ccc-install-dir %S/Inputs/hexagon_tree/Tools/bin \
+// RUN:   -mcpu=hexagonv60 \
 // RUN:   -msmall-data-threshold=8 \
 // RUN:   %s 2>&1 \
-// RUN:   | FileCheck -check-prefix=CHECK025 %s
-// CHECK025:      "-cc1"
-// CHECK025:        "-mrelocation-model" "static"
-// CHECK025:        "-mllvm" "-hexagon-small-data-threshold=8"
-// CHECK025-NEXT: "{{.*}}/bin{{/|\\\\}}hexagon-as"
-// CHECK025:        "-G8"
-// CHECK025-NEXT: "{{.*}}/bin{{/|\\\\}}hexagon-ld"
-// CHECK025:        "-G8"
+// RUN:   | FileCheck -check-prefix=CHECK042 %s
+// CHECK042:      "-cc1"
+// CHECK042:      "-mrelocation-model" "static"
+// CHECK042:      "-mllvm" "-hexagon-small-data-threshold=8"
+// CHECK042-NEXT: llvm-mc
+// CHECK042:      "-gpsize=8"
+// CHECK042-NEXT: hexagon-link
+// CHECK042:      "-G8"
 
 // -----------------------------------------------------------------------------
 // pie
 // -----------------------------------------------------------------------------
-// RUN: %clang -### -target hexagon-unknown-elf -fno-integrated-as    \
-// RUN:   -ccc-install-dir %S/Inputs/hexagon_tree/qc/bin \
-// RUN:   --gcc-toolchain="" \
+// RUN: %clang -### -target hexagon-unknown-elf \
+// RUN:   -ccc-install-dir %S/Inputs/hexagon_tree/Tools/bin \
+// RUN:   -mcpu=hexagonv60 \
 // RUN:   -pie \
 // RUN:   %s 2>&1 \
-// RUN:   | FileCheck -check-prefix=CHECK026 %s
-// CHECK026:      "-cc1"
-// CHECK026-NEXT: "{{.*}}/bin{{/|\\\\}}hexagon-as"
-// CHECK026-NEXT: "{{.*}}/bin{{/|\\\\}}hexagon-ld"
-// CHECK026:        "-pie"
-
-// RUN: %clang -### -target hexagon-unknown-elf -fno-integrated-as    \
-// RUN:   -ccc-install-dir %S/Inputs/hexagon_tree/qc/bin \
-// RUN:   --gcc-toolchain="" \
+// RUN:   | FileCheck -check-prefix=CHECK050 %s
+// CHECK050:      "-cc1"
+// CHECK050-NEXT: hexagon-link
+// CHECK050:      "-pie"
+
+// RUN: %clang -### -target hexagon-unknown-elf \
+// RUN:   -ccc-install-dir %S/Inputs/hexagon_tree/Tools/bin \
+// RUN:   -mcpu=hexagonv60 \
 // RUN:   -pie -shared \
 // RUN:   %s 2>&1 \
-// RUN:   | FileCheck -check-prefix=CHECK027 %s
-// CHECK027:      "-cc1"
-// CHECK027-NEXT: "{{.*}}/bin{{/|\\\\}}hexagon-as"
-// CHECK027-NEXT: "{{.*}}/bin{{/|\\\\}}hexagon-ld"
-// CHECK027-NOT:    "-pie"
-
-// -----------------------------------------------------------------------------
-// Misc Defaults
-// -----------------------------------------------------------------------------
-// RUN: %clang -### -target hexagon-unknown-elf -fno-integrated-as    \
-// RUN:   -ccc-install-dir %S/Inputs/hexagon_tree/qc/bin \
-// RUN:   --gcc-toolchain="" \
-// RUN:   %s 2>&1 \
-// RUN:   | FileCheck -check-prefix=CHECK028 %s
-// CHECK028:      "-cc1"
-// CHECK028:        "-mqdsp6-compat"
-// CHECK028:        "-Wreturn-type"
-// CHECK028-NEXT: "{{.*}}/bin{{/|\\\\}}hexagon-as"
-// CHECK028-NEXT: "{{.*}}/bin{{/|\\\\}}hexagon-ld"
+// RUN:   | FileCheck -check-prefix=CHECK051 %s
+// CHECK051:      "-cc1"
+// CHECK051-NEXT: hexagon-link
+// CHECK051-NOT:  "-pie"
 
 // -----------------------------------------------------------------------------
 // Test Assembler related args
 // -----------------------------------------------------------------------------
 // RUN: %clang -### -target hexagon-unknown-elf -fno-integrated-as    \
-// RUN:   -ccc-install-dir %S/Inputs/hexagon_tree/qc/bin \
-// RUN:   --gcc-toolchain="" \
+// RUN:   -ccc-install-dir %S/Inputs/hexagon_tree/Tools/bin \
+// RUN:   -mcpu=hexagonv60 \
 // RUN:   -gdwarf-2 \
 // RUN:   -Wa,--noexecstack,--trap \
 // RUN:   -Xassembler --keep-locals \
 // RUN:   %s 2>&1 \
-// RUN:   | FileCheck -check-prefix=CHECK029 %s
-// CHECK029:      "-cc1"
-// CHECK029-NEXT: "{{.*}}/bin{{/|\\\\}}hexagon-as"
-// CHECK029:      "--noexecstack" "--trap" "--keep-locals"
-// CHECK029-NEXT: "{{.*}}/bin{{/|\\\\}}hexagon-ld"
+// RUN:   | FileCheck -check-prefix=CHECK060 %s
+// CHECK060:      "-cc1"
+// CHECK060-NEXT: llvm-mc
+// CHECK060:      "--noexecstack" "--trap" "--keep-locals"
+// CHECK060-NEXT: hexagon-link
+
+// -----------------------------------------------------------------------------
+// Misc Defaults
+// -----------------------------------------------------------------------------
+// RUN: %clang -### -target hexagon-unknown-elf \
+// RUN:   -ccc-install-dir %S/Inputs/hexagon_tree/Tools/bin \
+// RUN:   -mcpu=hexagonv60 \
+// RUN:   %s 2>&1 \
+// RUN:   | FileCheck -check-prefix=CHECK070 %s
+// CHECK070:      "-cc1"
+// CHECK070:      "-Wreturn-type"

Removed: cfe/trunk/test/Driver/hexagon-toolchain.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/hexagon-toolchain.c?rev=255501&view=auto
==============================================================================
--- cfe/trunk/test/Driver/hexagon-toolchain.c (original)
+++ cfe/trunk/test/Driver/hexagon-toolchain.c (removed)
@@ -1,588 +0,0 @@
-// -----------------------------------------------------------------------------
-// Test standard include paths
-// -----------------------------------------------------------------------------
-
-// RUN: %clang -### -target hexagon-unknown-linux -fno-integrated-as    \
-// RUN:   -ccc-install-dir %S/Inputs/hexagon_tree/qc/bin \
-// RUN:   --gcc-toolchain="" \
-// RUN:   %s 2>&1 \
-// RUN:   | FileCheck -check-prefix=CHECK001 %s
-// CHECK001: "-cc1" {{.*}} "-internal-externc-isystem" "{{.*}}/Inputs/hexagon_tree/qc/bin/../../gnu/lib/gcc/hexagon/4.4.0/include"
-// CHECK001:   "-internal-externc-isystem" "{{.*}}/Inputs/hexagon_tree/qc/bin/../../gnu/lib/gcc/hexagon/4.4.0/include-fixed"
-// CHECK001:   "-internal-externc-isystem" "{{.*}}/Inputs/hexagon_tree/qc/bin/../../gnu/hexagon/include"
-// CHECK001-NEXT: "{{.*}}/Inputs/hexagon_tree/qc/bin/../../gnu/bin{{/|\\\\}}hexagon-as"
-
-// RUN: %clangxx -### -target hexagon-unknown-linux -fno-integrated-as    \
-// RUN:   -ccc-install-dir %S/Inputs/hexagon_tree/qc/bin \
-// RUN:   --gcc-toolchain="" \
-// RUN:   %s 2>&1 \
-// RUN:   | FileCheck -check-prefix=CHECK002 %s
-// CHECK002: "-cc1" {{.*}} "-internal-isystem" "[[INSTALL_DIR:.*]]/Inputs/hexagon_tree/qc/bin/../../gnu{{/|\\\\}}hexagon/include/c++/4.4.0"
-// CHECK002:   "-internal-externc-isystem" "{{.*}}/Inputs/hexagon_tree/qc/bin/../../gnu/lib/gcc/hexagon/4.4.0/include"
-// CHECK002:   "-internal-externc-isystem" "{{.*}}/Inputs/hexagon_tree/qc/bin/../../gnu/lib/gcc/hexagon/4.4.0/include-fixed"
-// CHECK002:   "-internal-externc-isystem" "{{.*}}/Inputs/hexagon_tree/qc/bin/../../gnu/hexagon/include"
-// CHECK002-NEXT: "{{.*}}/Inputs/hexagon_tree/qc/bin/../../gnu/bin{{/|\\\\}}hexagon-as"
-
-// -----------------------------------------------------------------------------
-// Test -nostdinc, -nostdlibinc, -nostdinc++
-// -----------------------------------------------------------------------------
-
-// RUN: %clang -### -target hexagon-unknown-linux -fno-integrated-as    \
-// RUN:   -ccc-install-dir %S/Inputs/hexagon_tree/qc/bin \
-// RUN:   --gcc-toolchain="" \
-// RUN:   -nostdinc \
-// RUN:   %s 2>&1 \
-// RUN:   | FileCheck -check-prefix=CHECK003 %s
-// CHECK003: "-cc1"
-// CHECK003-NOT: "-internal-externc-isystem" "{{.*}}/Inputs/hexagon_tree/qc/bin/../../gnu/lib/gcc/hexagon/4.4.0/include"
-// CHECK003-NOT: "-internal-externc-isystem" "{{.*}}/Inputs/hexagon_tree/qc/bin/../../gnu/lib/gcc/hexagon/4.4.0/include-fixed"
-// CHECK003-NOT: "-internal-externc-isystem" "{{.*}}/Inputs/hexagon_tree/qc/bin/../../gnu/hexagon/include"
-// CHECK003-NEXT: "{{.*}}/Inputs/hexagon_tree/qc/bin/../../gnu/bin{{/|\\\\}}hexagon-as"
-
-// RUN: %clang -### -target hexagon-unknown-linux -fno-integrated-as    \
-// RUN:   -ccc-install-dir %S/Inputs/hexagon_tree/qc/bin \
-// RUN:   --gcc-toolchain="" \
-// RUN:   -nostdlibinc \
-// RUN:   %s 2>&1 \
-// RUN:   | FileCheck -check-prefix=CHECK004 %s
-// CHECK004: "-cc1"
-// CHECK004-NOT: "-internal-externc-isystem" "{{.*}}/Inputs/hexagon_tree/qc/bin/../../gnu/lib/gcc/hexagon/4.4.0/include"
-// CHECK004-NOT: "-internal-externc-isystem" "{{.*}}/Inputs/hexagon_tree/qc/bin/../../gnu/lib/gcc/hexagon/4.4.0/include-fixed"
-// CHECK004-NOT: "-internal-externc-isystem" "{{.*}}/Inputs/hexagon_tree/qc/bin/../../gnu/hexagon/include"
-// CHECK004-NEXT: "{{.*}}/Inputs/hexagon_tree/qc/bin/../../gnu/bin{{/|\\\\}}hexagon-as"
-
-// RUN: %clangxx -### -target hexagon-unknown-linux -fno-integrated-as    \
-// RUN:   -ccc-install-dir %S/Inputs/hexagon_tree/qc/bin \
-// RUN:   --gcc-toolchain="" \
-// RUN:   -nostdlibinc \
-// RUN:   %s 2>&1 \
-// RUN:   | FileCheck -check-prefix=CHECK005 %s
-// CHECK005: "-cc1"
-// CHECK005-NOT: "-internal-isystem" "{{.*}}/Inputs/hexagon_tree/qc/bin/../../gnu/hexagon/include/c++/4.4.0"
-// CHECK005-NOT: "-internal-externc-isystem" "{{.*}}/Inputs/hexagon_tree/qc/bin/../../gnu/lib/gcc/hexagon/4.4.0/include"
-// CHECK005-NOT: "-internal-externc-isystem" "{{.*}}/Inputs/hexagon_tree/qc/bin/../../gnu/lib/gcc/hexagon/4.4.0/include-fixed"
-// CHECK005-NOT: "-internal-externc-isystem" "{{.*}}/Inputs/hexagon_tree/qc/bin/../../gnu/hexagon/include"
-// CHECK005-NEXT: "{{.*}}/Inputs/hexagon_tree/qc/bin/../../gnu/bin{{/|\\\\}}hexagon-as"
-
-// RUN: %clangxx -### -target hexagon-unknown-linux -fno-integrated-as    \
-// RUN:   -ccc-install-dir %S/Inputs/hexagon_tree/qc/bin \
-// RUN:   --gcc-toolchain="" \
-// RUN:   -nostdinc++ \
-// RUN:   %s 2>&1 \
-// RUN:   | FileCheck -check-prefix=CHECK006 %s
-// CHECK006: "-cc1"
-// CHECK006-NOT: "-internal-isystem" "{{.*}}/Inputs/hexagon_tree/qc/bin/../../gnu/hexagon/include/c++/4.4.0"
-// CHECK006-NEXT: "{{.*}}/Inputs/hexagon_tree/qc/bin/../../gnu/bin{{/|\\\\}}hexagon-as"
-
-// -----------------------------------------------------------------------------
-// Test -march=<archname> -mcpu=<archname> -mv<number>
-// -----------------------------------------------------------------------------
-// RUN: %clang -### -target hexagon-unknown-linux -fno-integrated-as    \
-// RUN:   -ccc-install-dir %S/Inputs/hexagon_tree/qc/bin \
-// RUN:   --gcc-toolchain="" \
-// RUN:   -march=hexagonv3 \
-// RUN:   %s 2>&1 \
-// RUN:   | FileCheck -check-prefix=CHECK007 %s
-// CHECK007: "-cc1" {{.*}} "-target-cpu" "hexagonv3"
-// CHECK007-NEXT: "{{.*}}/Inputs/hexagon_tree/qc/bin/../../gnu/bin{{/|\\\\}}hexagon-as"{{.*}} "-march=v3"
-// CHECK007-NEXT: "{{.*}}/Inputs/hexagon_tree/qc/bin/../../gnu/bin{{/|\\\\}}hexagon-ld"{{.*}} "-mv3"
-
-// RUN: %clang -### -target hexagon-unknown-linux -fno-integrated-as    \
-// RUN:   -ccc-install-dir %S/Inputs/hexagon_tree/qc/bin \
-// RUN:   --gcc-toolchain="" \
-// RUN:   -mcpu=hexagonv5 \
-// RUN:   %s 2>&1 \
-// RUN:   | FileCheck -check-prefix=CHECK008 %s
-// CHECK008: "-cc1" {{.*}} "-target-cpu" "hexagonv5"
-// CHECK008-NEXT: "{{.*}}/Inputs/hexagon_tree/qc/bin/../../gnu/bin{{/|\\\\}}hexagon-as"{{.*}} "-march=v5"
-// CHECK008-NEXT: "{{.*}}/Inputs/hexagon_tree/qc/bin/../../gnu/bin{{/|\\\\}}hexagon-ld"{{.*}} "-mv5"
-
-// RUN: %clang -### -target hexagon-unknown-linux -fno-integrated-as    \
-// RUN:   -ccc-install-dir %S/Inputs/hexagon_tree/qc/bin \
-// RUN:   --gcc-toolchain="" \
-// RUN:   -mv2 \
-// RUN:   %s 2>&1 \
-// RUN:   | FileCheck -check-prefix=CHECK009 %s
-// CHECK009: "-cc1" {{.*}} "-target-cpu" "hexagonv2"
-// CHECK009-NEXT: "{{.*}}/Inputs/hexagon_tree/qc/bin/../../gnu/bin{{/|\\\\}}hexagon-as"{{.*}} "-march=v2"
-// CHECK009-NEXT: "{{.*}}/Inputs/hexagon_tree/qc/bin/../../gnu/bin{{/|\\\\}}hexagon-ld"{{.*}} "-mv2"
-
-// RUN: %clang -### -target hexagon-unknown-linux -fno-integrated-as    \
-// RUN:   -ccc-install-dir %S/Inputs/hexagon_tree/qc/bin \
-// RUN:   --gcc-toolchain="" \
-// RUN:   %s 2>&1 \
-// RUN:   | FileCheck -check-prefix=CHECK010 %s
-// CHECK010: "-cc1" {{.*}} "-target-cpu" "hexagonv4"
-// CHECK010-NEXT: "{{.*}}/Inputs/hexagon_tree/qc/bin/../../gnu/bin{{/|\\\\}}hexagon-as"{{.*}} "-march=v4"
-// CHECK010-NEXT: "{{.*}}/Inputs/hexagon_tree/qc/bin/../../gnu/bin{{/|\\\\}}hexagon-ld"{{.*}} "-mv4"
-
-// RUN: not %clang -march=hexagonv2 -target hexagon-unknown-linux \
-// RUN:   %s 2>&1 | FileCheck -check-prefix=CHECK-UNKNOWN-V2 %s
-// RUN: not %clang -mcpu=hexagonv2  -target hexagon-unknown-linux \
-// RUN:   %s 2>&1 | FileCheck -check-prefix=CHECK-UNKNOWN-V2 %s
-// RUN: not %clang -mv2             -target hexagon-unknown-linux \
-// RUN:   %s 2>&1 | FileCheck -check-prefix=CHECK-UNKNOWN-V2 %s
-// CHECK-UNKNOWN-V2: error: unknown target CPU 'hexagonv2'
-
-// RUN: not %clang -march=hexagonv3 -target hexagon-unknown-linux \
-// RUN:   %s 2>&1 | FileCheck -check-prefix=CHECK-UNKNOWN-V3 %s
-// RUN: not %clang -mcpu=hexagonv3  -target hexagon-unknown-linux \
-// RUN:   %s 2>&1 | FileCheck -check-prefix=CHECK-UNKNOWN-V3 %s
-// RUN: not %clang -mv3             -target hexagon-unknown-linux \
-// RUN:   %s 2>&1 | FileCheck -check-prefix=CHECK-UNKNOWN-V3 %s
-// CHECK-UNKNOWN-V3: error: unknown target CPU 'hexagonv3'
-
-// -----------------------------------------------------------------------------
-// Test Linker related args
-// -----------------------------------------------------------------------------
-
-// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-// Defaults for C
-// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-// RUN: %clang -### -target hexagon-unknown-linux -fno-integrated-as    \
-// RUN:   -ccc-install-dir %S/Inputs/hexagon_tree/qc/bin \
-// RUN:   --gcc-toolchain="" \
-// RUN:   %s 2>&1 \
-// RUN:   | FileCheck -check-prefix=CHECK011 %s
-// CHECK011: "-cc1"
-// CHECK011-NEXT: "{{.*}}/bin{{/|\\\\}}hexagon-as"{{.*}}
-// CHECK011-NEXT: "{{.*}}/bin{{/|\\\\}}hexagon-ld"
-// CHECK011-NOT: "-static"
-// CHECK011-NOT: "-shared"
-// CHECK011: "{{.*}}/hexagon/lib/v4/crt0_standalone.o"
-// CHECK011: "{{.*}}/hexagon/lib/v4/crt0.o"
-// CHECK011: "{{.*}}/hexagon/lib/v4/init.o"
-// CHECK011: "-L{{.*}}/lib/gcc/hexagon/4.4.0/v4"
-// CHECK011: "-L{{.*}}/lib/gcc/hexagon/4.4.0"
-// CHECK011: "-L{{.*}}/lib/gcc"
-// CHECK011: "-L{{.*}}/hexagon/lib/v4"
-// CHECK011: "-L{{.*}}/hexagon/lib"
-// CHECK011: "{{[^"]+}}.o"
-// CHECK011: "--start-group" "-lstandalone" "-lc" "-lgcc" "--end-group"
-// CHECK011: "{{.*}}/hexagon/lib/v4/fini.o"
-
-// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-// Defaults for C++
-// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-// RUN: %clangxx -### -target hexagon-unknown-linux -fno-integrated-as    \
-// RUN:   -ccc-install-dir %S/Inputs/hexagon_tree/qc/bin \
-// RUN:   --gcc-toolchain="" \
-// RUN:   %s 2>&1 \
-// RUN:   | FileCheck -check-prefix=CHECK012 %s
-// CHECK012: "-cc1"
-// CHECK012-NEXT: "{{.*}}/bin{{/|\\\\}}hexagon-as"{{.*}}
-// CHECK012-NEXT: "{{.*}}/bin{{/|\\\\}}hexagon-ld"
-// CHECK012-NOT: "-static"
-// CHECK012-NOT: "-shared"
-// CHECK012: "{{.*}}/hexagon/lib/v4/crt0_standalone.o"
-// CHECK012: "{{.*}}/hexagon/lib/v4/crt0.o"
-// CHECK012: "{{.*}}/hexagon/lib/v4/init.o"
-// CHECK012: "-L{{.*}}/lib/gcc/hexagon/4.4.0/v4"
-// CHECK012: "-L{{.*}}/lib/gcc/hexagon/4.4.0"
-// CHECK012: "-L{{.*}}/lib/gcc"
-// CHECK012: "-L{{.*}}/hexagon/lib/v4"
-// CHECK012: "-L{{.*}}/hexagon/lib"
-// CHECK012: "{{[^"]+}}.o"
-// CHECK012: "-lstdc++" "-lm"
-// CHECK012: "--start-group" "-lstandalone" "-lc" "-lgcc" "--end-group"
-// CHECK012: "{{.*}}/hexagon/lib/v4/fini.o"
-
-// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-// Additional Libraries (-L)
-// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-// RUN: %clang -### -target hexagon-unknown-linux -fno-integrated-as    \
-// RUN:   -ccc-install-dir %S/Inputs/hexagon_tree/qc/bin \
-// RUN:   --gcc-toolchain="" \
-// RUN:   -Lone -L two -L three \
-// RUN:   %s 2>&1 \
-// RUN:   | FileCheck -check-prefix=CHECK013 %s
-// CHECK013: "-cc1"
-// CHECK013-NEXT: "{{.*}}/bin{{/|\\\\}}hexagon-as"{{.*}}
-// CHECK013-NEXT: "{{.*}}/bin{{/|\\\\}}hexagon-ld"
-// CHECK013: "{{.*}}/hexagon/lib/v4/crt0_standalone.o"
-// CHECK013: "{{.*}}/hexagon/lib/v4/crt0.o"
-// CHECK013: "{{.*}}/hexagon/lib/v4/init.o"
-// CHECK013: "-Lone" "-Ltwo" "-Lthree"
-// CHECK013: "-L{{.*}}/lib/gcc/hexagon/4.4.0/v4"
-// CHECK013: "-L{{.*}}/lib/gcc/hexagon/4.4.0"
-// CHECK013: "-L{{.*}}/lib/gcc"
-// CHECK013: "-L{{.*}}/hexagon/lib/v4"
-// CHECK013: "-L{{.*}}/hexagon/lib"
-// CHECK013: "{{[^"]+}}.o"
-// CHECK013: "--start-group" "-lstandalone" "-lc" "-lgcc" "--end-group"
-// CHECK013: "{{.*}}/hexagon/lib/v4/fini.o"
-
-// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-// -static, -shared
-// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-// RUN: %clang -### -target hexagon-unknown-linux -fno-integrated-as    \
-// RUN:   -ccc-install-dir %S/Inputs/hexagon_tree/qc/bin \
-// RUN:   --gcc-toolchain="" \
-// RUN:   -static \
-// RUN:   %s 2>&1 \
-// RUN:   | FileCheck -check-prefix=CHECK014 %s
-// CHECK014: "-cc1"
-// CHECK014-NEXT: "{{.*}}/bin{{/|\\\\}}hexagon-as"{{.*}}
-// CHECK014-NEXT: "{{.*}}/bin{{/|\\\\}}hexagon-ld"
-// CHECK014: "-static"
-// CHECK014: "{{.*}}/hexagon/lib/v4/crt0_standalone.o"
-// CHECK014: "{{.*}}/hexagon/lib/v4/crt0.o"
-// CHECK014: "{{.*}}/hexagon/lib/v4/init.o"
-// CHECK014: "-L{{.*}}/lib/gcc/hexagon/4.4.0/v4"
-// CHECK014: "-L{{.*}}/lib/gcc/hexagon/4.4.0"
-// CHECK014: "-L{{.*}}/lib/gcc"
-// CHECK014: "-L{{.*}}/hexagon/lib/v4"
-// CHECK014: "-L{{.*}}/hexagon/lib"
-// CHECK014: "{{[^"]+}}.o"
-// CHECK014: "--start-group" "-lstandalone" "-lc" "-lgcc" "--end-group"
-// CHECK014: "{{.*}}/hexagon/lib/v4/fini.o"
-
-// RUN: %clang -### -target hexagon-unknown-linux -fno-integrated-as    \
-// RUN:   -ccc-install-dir %S/Inputs/hexagon_tree/qc/bin \
-// RUN:   --gcc-toolchain="" \
-// RUN:   -shared \
-// RUN:   %s 2>&1 \
-// RUN:   | FileCheck -check-prefix=CHECK015 %s
-// CHECK015: "-cc1"
-// CHECK015-NEXT: "{{.*}}/bin{{/|\\\\}}hexagon-as"{{.*}}
-// CHECK015-NEXT: "{{.*}}/bin{{/|\\\\}}hexagon-ld"
-// CHECK015: "-shared" "-call_shared"
-// CHECK015-NOT: crt0_standalone.o
-// CHECK015-NOT: crt0.o
-// CHECK015: "{{.*}}/hexagon/lib/v4/G0/initS.o"
-// CHECK015: "-L{{.*}}/lib/gcc/hexagon/4.4.0/v4/G0"
-// CHECK015: "-L{{.*}}/lib/gcc/hexagon/4.4.0/G0"
-// CHECK015: "-L{{.*}}/lib/gcc/hexagon/4.4.0/v4"
-// CHECK015: "-L{{.*}}/lib/gcc/hexagon/4.4.0"
-// CHECK015: "-L{{.*}}/lib/gcc"
-// CHECK015: "-L{{.*}}/hexagon/lib/v4/G0"
-// CHECK015: "-L{{.*}}/hexagon/lib/G0"
-// CHECK015: "-L{{.*}}/hexagon/lib/v4"
-// CHECK015: "-L{{.*}}/hexagon/lib"
-// CHECK015: "{{[^"]+}}.o"
-// CHECK015: "--start-group"
-// CHECK015-NOT: "-lstandalone"
-// CHECK015-NOT: "-lc"
-// CHECK015: "-lgcc"
-// CHECK015: "--end-group"
-// CHECK015: "{{.*}}/hexagon/lib/v4/G0/finiS.o"
-
-// RUN: %clang -### -target hexagon-unknown-linux -fno-integrated-as    \
-// RUN:   -ccc-install-dir %S/Inputs/hexagon_tree/qc/bin \
-// RUN:   --gcc-toolchain="" \
-// RUN:   -shared \
-// RUN:   -static \
-// RUN:   %s 2>&1 \
-// RUN:   | FileCheck -check-prefix=CHECK016 %s
-// CHECK016: "-cc1"
-// CHECK016-NEXT: "{{.*}}/bin{{/|\\\\}}hexagon-as"{{.*}}
-// CHECK016-NEXT: "{{.*}}/bin{{/|\\\\}}hexagon-ld"
-// CHECK016: "-shared" "-call_shared" "-static"
-// CHECK016-NOT: crt0_standalone.o
-// CHECK016-NOT: crt0.o
-// CHECK016: "{{.*}}/hexagon/lib/v4/G0/init.o"
-// CHECK016: "-L{{.*}}/lib/gcc/hexagon/4.4.0/v4/G0"
-// CHECK016: "-L{{.*}}/lib/gcc/hexagon/4.4.0/G0"
-// CHECK016: "-L{{.*}}/lib/gcc/hexagon/4.4.0/v4"
-// CHECK016: "-L{{.*}}/lib/gcc/hexagon/4.4.0"
-// CHECK016: "-L{{.*}}/lib/gcc"
-// CHECK016: "-L{{.*}}/hexagon/lib/v4/G0"
-// CHECK016: "-L{{.*}}/hexagon/lib/G0"
-// CHECK016: "-L{{.*}}/hexagon/lib/v4"
-// CHECK016: "-L{{.*}}/hexagon/lib"
-// CHECK016: "{{[^"]+}}.o"
-// CHECK016: "--start-group"
-// CHECK016-NOT: "-lstandalone"
-// CHECK016-NOT: "-lc"
-// CHECK016: "-lgcc"
-// CHECK016: "--end-group"
-// CHECK016: "{{.*}}/hexagon/lib/v4/G0/fini.o"
-
-// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-// -nostdlib, -nostartfiles, -nodefaultlibs
-// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-// RUN: %clangxx -### -target hexagon-unknown-linux -fno-integrated-as    \
-// RUN:   -ccc-install-dir %S/Inputs/hexagon_tree/qc/bin \
-// RUN:   --gcc-toolchain="" \
-// RUN:   -nostdlib \
-// RUN:   %s 2>&1 \
-// RUN:   | FileCheck -check-prefix=CHECK017 %s
-// CHECK017: "-cc1"
-// CHECK017-NEXT: "{{.*}}/bin{{/|\\\\}}hexagon-as"{{.*}}
-// CHECK017-NEXT: "{{.*}}/bin{{/|\\\\}}hexagon-ld"
-// CHECK017-NOT: crt0_standalone.o
-// CHECK017-NOT: crt0.o
-// CHECK017-NOT: init.o
-// CHECK017: "-L{{.*}}/lib/gcc/hexagon/4.4.0/v4"
-// CHECK017: "-L{{.*}}/lib/gcc/hexagon/4.4.0"
-// CHECK017: "-L{{.*}}/lib/gcc"
-// CHECK017: "-L{{.*}}/hexagon/lib/v4"
-// CHECK017: "-L{{.*}}/hexagon/lib"
-// CHECK017: "{{[^"]+}}.o"
-// CHECK017-NOT: "-lstdc++"
-// CHECK017-NOT: "-lm"
-// CHECK017-NOT: "--start-group"
-// CHECK017-NOT: "-lstandalone"
-// CHECK017-NOT: "-lc"
-// CHECK017-NOT: "-lgcc"
-// CHECK017-NOT: "--end-group"
-// CHECK017-NOT: fini.o
-
-// RUN: %clangxx -### -target hexagon-unknown-linux -fno-integrated-as    \
-// RUN:   -ccc-install-dir %S/Inputs/hexagon_tree/qc/bin \
-// RUN:   --gcc-toolchain="" \
-// RUN:   -nostartfiles \
-// RUN:   %s 2>&1 \
-// RUN:   | FileCheck -check-prefix=CHECK018 %s
-// CHECK018: "-cc1"
-// CHECK018-NEXT: "{{.*}}/bin{{/|\\\\}}hexagon-as"{{.*}}
-// CHECK018-NEXT: "{{.*}}/bin{{/|\\\\}}hexagon-ld"
-// CHECK018-NOT: crt0_standalone.o
-// CHECK018-NOT: crt0.o
-// CHECK018-NOT: init.o
-// CHECK018: "-L{{.*}}/lib/gcc/hexagon/4.4.0/v4"
-// CHECK018: "-L{{.*}}/lib/gcc/hexagon/4.4.0"
-// CHECK018: "-L{{.*}}/lib/gcc"
-// CHECK018: "-L{{.*}}/hexagon/lib/v4"
-// CHECK018: "-L{{.*}}/hexagon/lib"
-// CHECK018: "{{[^"]+}}.o"
-// CHECK018: "-lstdc++"
-// CHECK018: "-lm"
-// CHECK018: "--start-group"
-// CHECK018: "-lstandalone"
-// CHECK018: "-lc"
-// CHECK018: "-lgcc"
-// CHECK018: "--end-group"
-// CHECK018-NOT: fini.o
-
-// RUN: %clangxx -### -target hexagon-unknown-linux -fno-integrated-as    \
-// RUN:   -ccc-install-dir %S/Inputs/hexagon_tree/qc/bin \
-// RUN:   --gcc-toolchain="" \
-// RUN:   -nodefaultlibs \
-// RUN:   %s 2>&1 \
-// RUN:   | FileCheck -check-prefix=CHECK019 %s
-// CHECK019: "-cc1"
-// CHECK019-NEXT: "{{.*}}/bin{{/|\\\\}}hexagon-as"{{.*}}
-// CHECK019-NEXT: "{{.*}}/bin{{/|\\\\}}hexagon-ld"
-// CHECK019: "{{.*}}/hexagon/lib/v4/crt0_standalone.o"
-// CHECK019: "{{.*}}/hexagon/lib/v4/crt0.o"
-// CHECK019: "{{.*}}/hexagon/lib/v4/init.o"
-// CHECK019: "-L{{.*}}/lib/gcc/hexagon/4.4.0/v4"
-// CHECK019: "-L{{.*}}/lib/gcc/hexagon/4.4.0"
-// CHECK019: "-L{{.*}}/lib/gcc"
-// CHECK019: "-L{{.*}}/hexagon/lib/v4"
-// CHECK019: "-L{{.*}}/hexagon/lib"
-// CHECK019: "{{[^"]+}}.o"
-// CHECK019-NOT: "-lstdc++"
-// CHECK019-NOT: "-lm"
-// CHECK019-NOT: "--start-group"
-// CHECK019-NOT: "-lstandalone"
-// CHECK019-NOT: "-lc"
-// CHECK019-NOT: "-lgcc"
-// CHECK019-NOT: "--end-group"
-// CHECK019: "{{.*}}/hexagon/lib/v4/fini.o"
-
-// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-// -moslib
-// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-// RUN: %clang -### -target hexagon-unknown-linux -fno-integrated-as    \
-// RUN:   -ccc-install-dir %S/Inputs/hexagon_tree/qc/bin \
-// RUN:   --gcc-toolchain="" \
-// RUN:   -moslib=first -moslib=second \
-// RUN:   %s 2>&1 \
-// RUN:   | FileCheck -check-prefix=CHECK020 %s
-// CHECK020: "-cc1"
-// CHECK020-NEXT: "{{.*}}/bin{{/|\\\\}}hexagon-as"{{.*}}
-// CHECK020-NEXT: "{{.*}}/bin{{/|\\\\}}hexagon-ld"
-// CHECK020-NOT: "-static"
-// CHECK020-NOT: "-shared"
-// CHECK020-NOT: crt0_standalone.o
-// CHECK020: "{{.*}}/hexagon/lib/v4/crt0.o"
-// CHECK020: "{{.*}}/hexagon/lib/v4/init.o"
-// CHECK020: "-L{{.*}}/lib/gcc/hexagon/4.4.0/v4"
-// CHECK020: "-L{{.*}}/lib/gcc/hexagon/4.4.0"
-// CHECK020: "-L{{.*}}/lib/gcc"
-// CHECK020: "-L{{.*}}/hexagon/lib/v4"
-// CHECK020: "-L{{.*}}/hexagon/lib"
-// CHECK020: "{{[^"]+}}.o"
-// CHECK020: "--start-group"
-// CHECK020: "-lfirst" "-lsecond"
-// CHECK020-NOT: "-lstandalone"
-// CHECK020: "-lc" "-lgcc" "--end-group"
-// CHECK020: "{{.*}}/hexagon/lib/v4/fini.o"
-
-// RUN: %clang -### -target hexagon-unknown-linux -fno-integrated-as    \
-// RUN:   -ccc-install-dir %S/Inputs/hexagon_tree/qc/bin \
-// RUN:   --gcc-toolchain="" \
-// RUN:   -moslib=first -moslib=second -moslib=standalone\
-// RUN:   %s 2>&1 \
-// RUN:   | FileCheck -check-prefix=CHECK021 %s
-// CHECK021: "-cc1"
-// CHECK021-NEXT: "{{.*}}/bin{{/|\\\\}}hexagon-as"{{.*}}
-// CHECK021-NEXT: "{{.*}}/bin{{/|\\\\}}hexagon-ld"
-// CHECK021-NOT: "-static"
-// CHECK021-NOT: "-shared"
-// CHECK021: "{{.*}}/hexagon/lib/v4/crt0_standalone.o"
-// CHECK021: "{{.*}}/hexagon/lib/v4/crt0.o"
-// CHECK021: "{{.*}}/hexagon/lib/v4/init.o"
-// CHECK021: "-L{{.*}}/lib/gcc/hexagon/4.4.0/v4"
-// CHECK021: "-L{{.*}}/lib/gcc/hexagon/4.4.0"
-// CHECK021: "-L{{.*}}/lib/gcc"
-// CHECK021: "-L{{.*}}/hexagon/lib/v4"
-// CHECK021: "-L{{.*}}/hexagon/lib"
-// CHECK021: "{{[^"]+}}.o"
-// CHECK021: "--start-group"
-// CHECK021: "-lfirst" "-lsecond"
-// CHECK021: "-lstandalone"
-// CHECK021: "-lc" "-lgcc" "--end-group"
-// CHECK021: "{{.*}}/hexagon/lib/v4/fini.o"
-
-// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-// Other args to pass to linker
-// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-// RUN: %clangxx -### -target hexagon-unknown-linux -fno-integrated-as    \
-// RUN:   -ccc-install-dir %S/Inputs/hexagon_tree/qc/bin \
-// RUN:   --gcc-toolchain="" \
-// RUN:   -s \
-// RUN:   -Tbss 0xdead -Tdata 0xbeef -Ttext 0xcafe \
-// RUN:   -t \
-// RUN:   -e start_here \
-// RUN:   -uFoo -undefined Bar \
-// RUN:   %s 2>&1 \
-// RUN:   | FileCheck -check-prefix=CHECK022 %s
-// CHECK022: "-cc1"
-// CHECK022-NEXT: "{{.*}}/bin{{/|\\\\}}hexagon-as"{{.*}}
-// CHECK022-NEXT: "{{.*}}/bin{{/|\\\\}}hexagon-ld"
-// CHECK022: "{{.*}}/hexagon/lib/v4/crt0_standalone.o"
-// CHECK022: "{{.*}}/hexagon/lib/v4/crt0.o"
-// CHECK022: "{{.*}}/hexagon/lib/v4/init.o"
-// CHECK022: "-L{{.*}}/lib/gcc/hexagon/4.4.0/v4"
-// CHECK022: "-L{{.*}}/lib/gcc/hexagon/4.4.0"
-// CHECK022: "-L{{.*}}/lib/gcc"
-// CHECK022: "-L{{.*}}/hexagon/lib/v4"
-// CHECK022: "-L{{.*}}/hexagon/lib"
-// CHECK022: "-s"
-// CHECK022: "-Tbss" "0xdead" "-Tdata" "0xbeef" "-Ttext" "0xcafe"
-// CHECK022: "-t"
-// CHECK022: "-u" "Foo" "-undefined" "Bar"
-// CHECK022: "{{[^"]+}}.o"
-// CHECK022: "-lstdc++" "-lm"
-// CHECK022: "--start-group" "-lstandalone" "-lc" "-lgcc" "--end-group"
-// CHECK022: "{{.*}}/hexagon/lib/v4/fini.o"
-
-// -----------------------------------------------------------------------------
-// pic, small data threshold
-// -----------------------------------------------------------------------------
-// RUN: %clang -### -target hexagon-unknown-linux -fno-integrated-as    \
-// RUN:   -ccc-install-dir %S/Inputs/hexagon_tree/qc/bin \
-// RUN:   --gcc-toolchain="" \
-// RUN:   %s 2>&1 \
-// RUN:   | FileCheck -check-prefix=CHECK023 %s
-// CHECK023:      "-cc1"
-// CHECK023:        "-mrelocation-model" "static"
-// CHECK023-NEXT: "{{.*}}/bin{{/|\\\\}}hexagon-as"
-// CHECK023-NOT:    "-G{{[0-9]+}}"
-// CHECK023-NEXT: "{{.*}}/bin{{/|\\\\}}hexagon-ld"
-// CHECK023-NOT:    "-G{{[0-9]+}}"
-
-// RUN: %clang -### -target hexagon-unknown-linux -fno-integrated-as    \
-// RUN:   -ccc-install-dir %S/Inputs/hexagon_tree/qc/bin \
-// RUN:   --gcc-toolchain="" \
-// RUN:   -fpic \
-// RUN:   %s 2>&1 \
-// RUN:   | sed -e "s/\.exe//" -e "s/\.EXE//" | FileCheck -check-prefix=CHECK024 %s
-// RUN: %clang -### -target hexagon-unknown-linux -fno-integrated-as    \
-// RUN:   -ccc-install-dir %S/Inputs/hexagon_tree/qc/bin \
-// RUN:   --gcc-toolchain="" \
-// RUN:   -fPIC \
-// RUN:   %s 2>&1 \
-// RUN:   | FileCheck -check-prefix=CHECK024 %s
-// CHECK024:      "-cc1"
-// CHECK024-NOT:    "-mrelocation-model" "static"
-// CHECK024:        "-pic-level" "{{[12]}}"
-// CHECK024:        "-mllvm" "-hexagon-small-data-threshold=0"
-// CHECK024-NEXT: "{{.*}}/bin{{/|\\\\}}hexagon-as"
-// CHECK024:        "-G0"
-// CHECK024-NEXT: "{{.*}}/bin{{/|\\\\}}hexagon-ld"
-// CHECK024:        "-G0"
-
-// RUN: %clang -### -target hexagon-unknown-linux -fno-integrated-as    \
-// RUN:   -ccc-install-dir %S/Inputs/hexagon_tree/qc/bin \
-// RUN:   --gcc-toolchain="" \
-// RUN:   -G=8 \
-// RUN:   %s 2>&1 \
-// RUN:   | FileCheck -check-prefix=CHECK025 %s
-// RUN: %clang -### -target hexagon-unknown-linux -fno-integrated-as    \
-// RUN:   -ccc-install-dir %S/Inputs/hexagon_tree/qc/bin \
-// RUN:   --gcc-toolchain="" \
-// RUN:   -G 8 \
-// RUN:   %s 2>&1 \
-// RUN:   | FileCheck -check-prefix=CHECK025 %s
-// RUN: %clang -### -target hexagon-unknown-linux -fno-integrated-as    \
-// RUN:   -ccc-install-dir %S/Inputs/hexagon_tree/qc/bin \
-// RUN:   --gcc-toolchain="" \
-// RUN:   -msmall-data-threshold=8 \
-// RUN:   %s 2>&1 \
-// RUN:   | FileCheck -check-prefix=CHECK025 %s
-// CHECK025:      "-cc1"
-// CHECK025:        "-mrelocation-model" "static"
-// CHECK025:        "-mllvm" "-hexagon-small-data-threshold=8"
-// CHECK025-NEXT: "{{.*}}/bin{{/|\\\\}}hexagon-as"
-// CHECK025:        "-G8"
-// CHECK025-NEXT: "{{.*}}/bin{{/|\\\\}}hexagon-ld"
-// CHECK025:        "-G8"
-
-// -----------------------------------------------------------------------------
-// pie
-// -----------------------------------------------------------------------------
-// RUN: %clang -### -target hexagon-unknown-linux -fno-integrated-as    \
-// RUN:   -ccc-install-dir %S/Inputs/hexagon_tree/qc/bin \
-// RUN:   --gcc-toolchain="" \
-// RUN:   -pie \
-// RUN:   %s 2>&1 \
-// RUN:   | FileCheck -check-prefix=CHECK026 %s
-// CHECK026:      "-cc1"
-// CHECK026-NEXT: "{{.*}}/bin{{/|\\\\}}hexagon-as"
-// CHECK026-NEXT: "{{.*}}/bin{{/|\\\\}}hexagon-ld"
-// CHECK026:        "-pie"
-
-// RUN: %clang -### -target hexagon-unknown-linux -fno-integrated-as    \
-// RUN:   -ccc-install-dir %S/Inputs/hexagon_tree/qc/bin \
-// RUN:   --gcc-toolchain="" \
-// RUN:   -pie -shared \
-// RUN:   %s 2>&1 \
-// RUN:   | FileCheck -check-prefix=CHECK027 %s
-// CHECK027:      "-cc1"
-// CHECK027-NEXT: "{{.*}}/bin{{/|\\\\}}hexagon-as"
-// CHECK027-NEXT: "{{.*}}/bin{{/|\\\\}}hexagon-ld"
-// CHECK027-NOT:    "-pie"
-
-// -----------------------------------------------------------------------------
-// Misc Defaults
-// -----------------------------------------------------------------------------
-// RUN: %clang -### -target hexagon-unknown-linux -fno-integrated-as    \
-// RUN:   -ccc-install-dir %S/Inputs/hexagon_tree/qc/bin \
-// RUN:   --gcc-toolchain="" \
-// RUN:   %s 2>&1 \
-// RUN:   | FileCheck -check-prefix=CHECK028 %s
-// CHECK028:      "-cc1"
-// CHECK028:        "-mqdsp6-compat"
-// CHECK028:        "-Wreturn-type"
-// CHECK028-NEXT: "{{.*}}/bin{{/|\\\\}}hexagon-as"
-// CHECK028-NEXT: "{{.*}}/bin{{/|\\\\}}hexagon-ld"
-
-// -----------------------------------------------------------------------------
-// Test Assembler related args
-// -----------------------------------------------------------------------------
-// RUN: %clang -### -target hexagon-unknown-linux -fno-integrated-as    \
-// RUN:   -ccc-install-dir %S/Inputs/hexagon_tree/qc/bin \
-// RUN:   --gcc-toolchain="" \
-// RUN:   -gdwarf-2 \
-// RUN:   -Wa,--noexecstack,--trap \
-// RUN:   -Xassembler --keep-locals \
-// RUN:   %s 2>&1 \
-// RUN:   | FileCheck -check-prefix=CHECK029 %s
-// CHECK029:      "-cc1"
-// CHECK029-NEXT: "{{.*}}/bin{{/|\\\\}}hexagon-as"
-// CHECK029:      "--noexecstack" "--trap" "--keep-locals"
-// CHECK029-NEXT: "{{.*}}/bin{{/|\\\\}}hexagon-ld"




More information about the cfe-commits mailing list