forked from OSchip/llvm-project
[driver] Before applying the working directory check if the input path
is absolute. llvm-svn: 166808
This commit is contained in:
parent
4a2dcfe5ee
commit
c2c77c42ef
|
|
@ -1018,8 +1018,8 @@ void Driver::BuildInputs(const ToolChain &TC, const DerivedArgList &Args,
|
||||||
if (CheckInputsExist && memcmp(Value, "-", 2) != 0) {
|
if (CheckInputsExist && memcmp(Value, "-", 2) != 0) {
|
||||||
SmallString<64> Path(Value);
|
SmallString<64> Path(Value);
|
||||||
if (Arg *WorkDir = Args.getLastArg(options::OPT_working_directory)) {
|
if (Arg *WorkDir = Args.getLastArg(options::OPT_working_directory)) {
|
||||||
SmallString<64> Directory(WorkDir->getValue(Args));
|
if (!llvm::sys::path::is_absolute(Path.str())) {
|
||||||
if (llvm::sys::path::is_absolute(Directory.str())) {
|
SmallString<64> Directory(WorkDir->getValue(Args));
|
||||||
llvm::sys::path::append(Directory, Value);
|
llvm::sys::path::append(Directory, Value);
|
||||||
Path.assign(Directory);
|
Path.assign(Directory);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1 @@
|
||||||
|
// RUN: %clang -working-directory=%S %S/working-directory-and-abs.c -fsyntax-only
|
||||||
Loading…
Reference in New Issue