Skip to content

Commit

Permalink
clang-cl pch test: Instead of copying the input, use /Fp to not write…
Browse files Browse the repository at this point in the history
… into the test directory.

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


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@262541 91177308-0d34-0410-b5e6-96231b3b80d8
  • Loading branch information
nico committed Mar 2, 2016
1 parent f2ba171 commit 3412720
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
2 changes: 1 addition & 1 deletion lib/Driver/Driver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2246,7 +2246,7 @@ const char *Driver::GetNamedOutputPath(Compilation &C, const JobAction &JA,
}

// 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;
Expand Down
3 changes: 1 addition & 2 deletions test/Driver/cl-pch-errorhandling.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 3412720

Please sign in to comment.