]> granicus.if.org Git - clang/commitdiff
Fix clash of gcc toolchains in hexagon driver regression tests.
authorSamuel Antao <sfantao@us.ibm.com>
Fri, 7 Nov 2014 17:48:03 +0000 (17:48 +0000)
committerSamuel Antao <sfantao@us.ibm.com>
Fri, 7 Nov 2014 17:48:03 +0000 (17:48 +0000)
If clang was configured with a custom gcc toolchain (either by using GCC_INSTALL_PREFIX in cmake or the equivalent configure command), the path to the custom gcc toolchain path takes precedence to the one specified by -ccc-install-dir. This causes several regression tests to fail as they will be using an unexpected path. Adding the switch --gcc-toolchain="" in each test command is not enough as the hexagon toolchain implementation in the driver is not evaluating this argument. This commit modifies the hexagon toolchain to take the --gcc-toolchain="" argument into account when deciding the toolchain path, similarly to what is already done for other targets toolchains. Additionally, the faulty regression tests are modified in order to --gcc-toolchain="" be passed to the commands.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@221535 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Driver/ToolChains.cpp
lib/Driver/ToolChains.h
lib/Driver/Tools.cpp
test/Driver/hexagon-toolchain-elf.c
test/Driver/hexagon-toolchain.c

index e1d48ef343ce455d7090659c32ce272a0979c158..17ef1075092ea85bd1bdc2ca125ba88f4e03134d 100644 (file)
@@ -2091,11 +2091,14 @@ void Generic_ELF::addClangTargetOptions(const ArgList &DriverArgs,
 
 /// Hexagon Toolchain
 
-std::string Hexagon_TC::GetGnuDir(const std::string &InstalledDir) {
+std::string Hexagon_TC::GetGnuDir(const std::string &InstalledDir,
+                                  const ArgList &Args) {
 
   // Locate the rest of the toolchain ...
-  if (strlen(GCC_INSTALL_PREFIX))
-    return std::string(GCC_INSTALL_PREFIX);
+  std::string GccToolchain = getGCCToolchainDir(Args);
+
+  if (!GccToolchain.empty())
+    return GccToolchain;
 
   std::string InstallRelDir = InstalledDir + "/../../gnu";
   if (llvm::sys::fs::exists(InstallRelDir))
@@ -2135,7 +2138,7 @@ static void GetHexagonLibraryPaths(
   const std::string MarchSuffix = "/" + MarchString;
   const std::string G0Suffix = "/G0";
   const std::string MarchG0Suffix = MarchSuffix + G0Suffix;
-  const std::string RootDir = Hexagon_TC::GetGnuDir(InstalledDir) + "/";
+  const std::string RootDir = Hexagon_TC::GetGnuDir(InstalledDir, Args) + "/";
 
   // lib/gcc/hexagon/...
   std::string LibGCCHexagonDir = RootDir + "lib/gcc/hexagon/";
@@ -2163,7 +2166,7 @@ Hexagon_TC::Hexagon_TC(const Driver &D, const llvm::Triple &Triple,
                        const ArgList &Args)
   : Linux(D, Triple, Args) {
   const std::string InstalledDir(getDriver().getInstalledDir());
-  const std::string GnuDir = Hexagon_TC::GetGnuDir(InstalledDir);
+  const std::string GnuDir = Hexagon_TC::GetGnuDir(InstalledDir, Args);
 
   // Note: Generic_GCC::Generic_GCC adds InstalledDir and getDriver().Dir to
   // program paths
@@ -2218,7 +2221,7 @@ void Hexagon_TC::AddClangSystemIncludeArgs(const ArgList &DriverArgs,
     return;
 
   std::string Ver(GetGCCLibAndIncVersion());
-  std::string GnuDir = Hexagon_TC::GetGnuDir(D.InstalledDir);
+  std::string GnuDir = Hexagon_TC::GetGnuDir(D.InstalledDir, DriverArgs);
   std::string HexagonDir(GnuDir + "/lib/gcc/hexagon/" + Ver);
   addExternCSystemInclude(DriverArgs, CC1Args, HexagonDir + "/include");
   addExternCSystemInclude(DriverArgs, CC1Args, HexagonDir + "/include-fixed");
@@ -2234,7 +2237,8 @@ void Hexagon_TC::AddClangCXXStdlibIncludeArgs(const ArgList &DriverArgs,
 
   const Driver &D = getDriver();
   std::string Ver(GetGCCLibAndIncVersion());
-  SmallString<128> IncludeDir(Hexagon_TC::GetGnuDir(D.InstalledDir));
+  SmallString<128> IncludeDir(
+      Hexagon_TC::GetGnuDir(D.InstalledDir, DriverArgs));
 
   llvm::sys::path::append(IncludeDir, "hexagon/include/c++/");
   llvm::sys::path::append(IncludeDir, Ver);
index 532a7cf00b0b967826abd2ccce2a5b54753cd272..876bb01f33a77ae83af2cd521f30ab2e61a18339 100644 (file)
@@ -709,7 +709,8 @@ public:
 
   StringRef GetGCCLibAndIncVersion() const { return GCCLibAndIncVersion.Text; }
 
-  static std::string GetGnuDir(const std::string &InstalledDir);
+  static std::string GetGnuDir(const std::string &InstalledDir,
+                               const llvm::opt::ArgList &Args);
 
   static StringRef GetTargetCPU(const llvm::opt::ArgList &Args);
 };
index 24d602f7054a145cb5d42a4ccedd5175a1275dd7..ca705c14339254f5ebeb862116c020a3a70343a1 100644 (file)
@@ -5249,8 +5249,8 @@ void hexagon::Link::ConstructJob(Compilation &C, const JobAction &JA,
   const std::string MarchSuffix = "/" + MarchString;
   const std::string G0Suffix = "/G0";
   const std::string MarchG0Suffix = MarchSuffix + G0Suffix;
-  const std::string RootDir = toolchains::Hexagon_TC::GetGnuDir(D.InstalledDir)
-                              + "/";
+  const std::string RootDir =
+      toolchains::Hexagon_TC::GetGnuDir(D.InstalledDir, Args) + "/";
   const std::string StartFilesDir = RootDir
                                     + "hexagon/lib"
                                     + (buildingLib
index b25b974f0a3d9cd82f8318207c5ccbefade88ff1..984dc0439ddbfc65f91e5c691ce7dd9cb73bd8f0 100644 (file)
@@ -4,6 +4,7 @@
 
 // RUN: %clang -### -target hexagon-unknown-elf     \
 // 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"
@@ -13,6 +14,7 @@
 
 // RUN: %clangxx -### -target hexagon-unknown-elf     \
 // 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"
@@ -27,6 +29,7 @@
 
 // RUN: %clang -### -target hexagon-unknown-elf     \
 // 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
@@ -38,6 +41,7 @@
 
 // RUN: %clang -### -target hexagon-unknown-elf     \
 // 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
@@ -49,6 +53,7 @@
 
 // RUN: %clangxx -### -target hexagon-unknown-elf     \
 // 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
@@ -61,6 +66,7 @@
 
 // RUN: %clangxx -### -target hexagon-unknown-elf     \
 // 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
@@ -73,6 +79,7 @@
 // -----------------------------------------------------------------------------
 // RUN: %clang -### -target hexagon-unknown-elf     \
 // 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
@@ -82,6 +89,7 @@
 
 // RUN: %clang -### -target hexagon-unknown-elf     \
 // 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
@@ -91,6 +99,7 @@
 
 // RUN: %clang -### -target hexagon-unknown-elf     \
 // 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
 
 // RUN: %clang -### -target hexagon-unknown-elf     \
 // 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"
 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 // RUN: %clang -### -target hexagon-unknown-elf     \
 // 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"
 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 // RUN: %clangxx -### -target hexagon-unknown-elf     \
 // 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"
 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 // RUN: %clang -### -target hexagon-unknown-elf     \
 // 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
 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 // RUN: %clang -### -target hexagon-unknown-elf     \
 // 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
 
 // RUN: %clang -### -target hexagon-unknown-elf     \
 // 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
 
 // RUN: %clang -### -target hexagon-unknown-elf     \
 // RUN:   -ccc-install-dir %S/Inputs/hexagon_tree/qc/bin \
+// RUN:   --gcc-toolchain="" \
 // RUN:   -shared \
 // RUN:   -static \
 // RUN:   %s 2>&1 \
 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 // RUN: %clangxx -### -target hexagon-unknown-elf     \
 // 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
 
 // RUN: %clangxx -### -target hexagon-unknown-elf     \
 // 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
 
 // RUN: %clangxx -### -target hexagon-unknown-elf     \
 // 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
 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 // RUN: %clang -### -target hexagon-unknown-elf     \
 // 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
 
 // RUN: %clang -### -target hexagon-unknown-elf     \
 // 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
 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 // RUN: %clangxx -### -target hexagon-unknown-elf     \
 // 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: %clang -### -target hexagon-unknown-elf     \
 // 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"
 
 // RUN: %clang -### -target hexagon-unknown-elf     \
 // 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
 // RUN: %clang -### -target hexagon-unknown-elf     \
 // 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
 // RUN: %clang -### -target hexagon-unknown-elf     \
 // RUN:   -ccc-install-dir %S/Inputs/hexagon_tree/qc/bin \
+// RUN:   --gcc-toolchain="" \
 // RUN:   -fPIC \
 // RUN:   -msmall-data-threshold=8 \
 // RUN:   %s 2>&1 \
 
 // RUN: %clang -### -target hexagon-unknown-elf     \
 // 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-elf     \
 // 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-elf     \
 // 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
 // -----------------------------------------------------------------------------
 // RUN: %clang -### -target hexagon-unknown-elf     \
 // 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
 
 // RUN: %clang -### -target hexagon-unknown-elf     \
 // 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
 // -----------------------------------------------------------------------------
 // RUN: %clang -### -target hexagon-unknown-elf     \
 // 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"
 // -----------------------------------------------------------------------------
 // RUN: %clang -### -target hexagon-unknown-elf     \
 // RUN:   -ccc-install-dir %S/Inputs/hexagon_tree/qc/bin \
+// RUN:   --gcc-toolchain="" \
 // RUN:   -gdwarf-2 \
 // RUN:   -Wa,--noexecstack,--trap \
 // RUN:   -Xassembler --keep-locals \
index 384df80873c23e1a4b98f4373e03c0b1dfc19517..391b78a13ea621e85c09f244145a40fb144ab1a4 100644 (file)
@@ -4,6 +4,7 @@
 
 // RUN: %clang -### -target hexagon-unknown-linux     \
 // 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"
@@ -13,6 +14,7 @@
 
 // RUN: %clangxx -### -target hexagon-unknown-linux     \
 // 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"
@@ -27,6 +29,7 @@
 
 // RUN: %clang -### -target hexagon-unknown-linux     \
 // 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
@@ -38,6 +41,7 @@
 
 // RUN: %clang -### -target hexagon-unknown-linux     \
 // 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
@@ -49,6 +53,7 @@
 
 // RUN: %clangxx -### -target hexagon-unknown-linux     \
 // 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
@@ -61,6 +66,7 @@
 
 // RUN: %clangxx -### -target hexagon-unknown-linux     \
 // 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
@@ -73,6 +79,7 @@
 // -----------------------------------------------------------------------------
 // RUN: %clang -### -target hexagon-unknown-linux     \
 // 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
@@ -82,6 +89,7 @@
 
 // RUN: %clang -### -target hexagon-unknown-linux     \
 // 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
@@ -91,6 +99,7 @@
 
 // RUN: %clang -### -target hexagon-unknown-linux     \
 // 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
 
 // RUN: %clang -### -target hexagon-unknown-linux     \
 // 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"
 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 // RUN: %clang -### -target hexagon-unknown-linux     \
 // 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"
 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 // RUN: %clangxx -### -target hexagon-unknown-linux     \
 // 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"
 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 // RUN: %clang -### -target hexagon-unknown-linux     \
 // 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
 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 // RUN: %clang -### -target hexagon-unknown-linux     \
 // 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
 
 // RUN: %clang -### -target hexagon-unknown-linux     \
 // 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
 
 // RUN: %clang -### -target hexagon-unknown-linux     \
 // RUN:   -ccc-install-dir %S/Inputs/hexagon_tree/qc/bin \
+// RUN:   --gcc-toolchain="" \
 // RUN:   -shared \
 // RUN:   -static \
 // RUN:   %s 2>&1 \
 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 // RUN: %clangxx -### -target hexagon-unknown-linux     \
 // 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
 
 // RUN: %clangxx -### -target hexagon-unknown-linux     \
 // 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
 
 // RUN: %clangxx -### -target hexagon-unknown-linux     \
 // 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
 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 // RUN: %clang -### -target hexagon-unknown-linux     \
 // 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
 
 // RUN: %clang -### -target hexagon-unknown-linux     \
 // 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
 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 // RUN: %clangxx -### -target hexagon-unknown-linux     \
 // 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: %clang -### -target hexagon-unknown-linux     \
 // 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"
 
 // RUN: %clang -### -target hexagon-unknown-linux     \
 // 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
 // RUN: %clang -### -target hexagon-unknown-linux     \
 // 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
 // RUN: %clang -### -target hexagon-unknown-linux     \
 // RUN:   -ccc-install-dir %S/Inputs/hexagon_tree/qc/bin \
+// RUN:   --gcc-toolchain="" \
 // RUN:   -fPIC \
 // RUN:   -msmall-data-threshold=8 \
 // RUN:   %s 2>&1 \
 
 // RUN: %clang -### -target hexagon-unknown-linux     \
 // 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     \
 // 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     \
 // 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
 // -----------------------------------------------------------------------------
 // RUN: %clang -### -target hexagon-unknown-linux     \
 // 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
 
 // RUN: %clang -### -target hexagon-unknown-linux     \
 // 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
 // -----------------------------------------------------------------------------
 // RUN: %clang -### -target hexagon-unknown-linux     \
 // 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"
 // -----------------------------------------------------------------------------
 // RUN: %clang -### -target hexagon-unknown-linux     \
 // RUN:   -ccc-install-dir %S/Inputs/hexagon_tree/qc/bin \
+// RUN:   --gcc-toolchain="" \
 // RUN:   -gdwarf-2 \
 // RUN:   -Wa,--noexecstack,--trap \
 // RUN:   -Xassembler --keep-locals \