[PATCH] D13920: Minor fix in ToolChainTest.cpp to allow user defined GCC toolchain.

Samuel Antao via cfe-commits cfe-commits at lists.llvm.org
Tue Oct 20 16:09:35 PDT 2015


sfantao created this revision.
sfantao added a reviewer: bkramer.
sfantao added a subscriber: cfe-commits.

If the user configured clang with a custom GCC toolchain that will take precedence on what the ToolChainTest.cpp expects to evaluate. This was causing the test to fail in these cases.

This patch fixes the issue by passing --gcc-toolchain= to the driver, in order to override any user defined GCC toolchain.

 

http://reviews.llvm.org/D13920

Files:
  unittests/Driver/ToolChainTest.cpp

Index: unittests/Driver/ToolChainTest.cpp
===================================================================
--- unittests/Driver/ToolChainTest.cpp
+++ unittests/Driver/ToolChainTest.cpp
@@ -58,8 +58,8 @@
     InMemoryFileSystem->addFile(Path, 0,
                                 llvm::MemoryBuffer::getMemBuffer("\n"));
 
-  std::unique_ptr<Compilation> C(
-      TheDriver.BuildCompilation({"-fsyntax-only", "foo.cpp"}));
+  std::unique_ptr<Compilation> C(TheDriver.BuildCompilation(
+      {"-fsyntax-only", "--gcc-toolchain=", "foo.cpp"}));
 
   std::string S;
   {
@@ -97,8 +97,8 @@
     InMemoryFileSystem->addFile(Path, 0,
                                 llvm::MemoryBuffer::getMemBuffer("\n"));
 
-  std::unique_ptr<Compilation> C(
-      TheDriver.BuildCompilation({"-fsyntax-only", "foo.cpp"}));
+  std::unique_ptr<Compilation> C(TheDriver.BuildCompilation(
+      {"-fsyntax-only", "--gcc-toolchain=", "foo.cpp"}));
 
   std::string S;
   {


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D13920.37942.patch
Type: text/x-patch
Size: 954 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20151020/e444699f/attachment.bin>


More information about the cfe-commits mailing list