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.

llvm-svn: 262541
This commit is contained in:
Nico Weber 2016-03-02 23:29:29 +00:00
parent 840564973f
commit 8ab9219295
2 changed files with 2 additions and 3 deletions

View File

@ -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;

View File

@ -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