r262541 - clang-cl pch test: Instead of copying the input, use /Fp to not write into the test directory.

Nico Weber via cfe-commits cfe-commits at lists.llvm.org
Wed Mar 2 15:29:30 PST 2016


Author: nico
Date: Wed Mar  2 17:29:29 2016
New Revision: 262541

URL: http://llvm.org/viewvc/llvm-project?rev=262541&view=rev
Log:
clang-cl pch test: Instead of copying the input, use /Fp to not write into the test directory.

Also fix a bug with /Fp and absolute paths uncovered by this.
Follow-up to r262487.

Modified:
    cfe/trunk/lib/Driver/Driver.cpp
    cfe/trunk/test/Driver/cl-pch-errorhandling.cpp

Modified: cfe/trunk/lib/Driver/Driver.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/Driver.cpp?rev=262541&r1=262540&r2=262541&view=diff
==============================================================================
--- cfe/trunk/lib/Driver/Driver.cpp (original)
+++ cfe/trunk/lib/Driver/Driver.cpp Wed Mar  2 17:29:29 2016
@@ -2246,7 +2246,7 @@ const char *Driver::GetNamedOutputPath(C
   }
 
   // As an annoying special case, PCH generation doesn't strip the pathname.
-  if (JA.getType() == types::TY_PCH) {
+  if (JA.getType() == types::TY_PCH && !IsCLMode()) {
     llvm::sys::path::remove_filename(BasePath);
     if (BasePath.empty())
       BasePath = NamedOutput;

Modified: cfe/trunk/test/Driver/cl-pch-errorhandling.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/cl-pch-errorhandling.cpp?rev=262541&r1=262540&r2=262541&view=diff
==============================================================================
--- cfe/trunk/test/Driver/cl-pch-errorhandling.cpp (original)
+++ cfe/trunk/test/Driver/cl-pch-errorhandling.cpp Wed Mar  2 17:29:29 2016
@@ -6,8 +6,7 @@
 // code generation, which makes this test require an x86 backend.
 // REQUIRES: x86-registered-target
 
-// RUN: cp %S/Inputs/pchfile.h %t.h
-// RUN: not %clang_cl -internal-enable-pch -Werror /Yc%t.h /FI%t.h /c -DERR_HEADER -- %s 2>&1 \
+// RUN: not %clang_cl -internal-enable-pch -Werror /Yc%S/Inputs/pchfile.h /FI%S/Inputs/pchfile.h /Fp%t.pch /c -DERR_HEADER -- %s 2>&1 \
 // RUN:   | FileCheck %s
 
 // CHECK: nope1




More information about the cfe-commits mailing list