Quote arguments for --reproduce.

llvm-svn: 268258
This commit is contained in:
Rui Ueyama 2016-05-02 17:34:17 +00:00
parent bc46f624cd
commit e951a1d739
2 changed files with 7 additions and 2 deletions

View File

@ -181,7 +181,10 @@ void elf::createResponseFile(const llvm::opt::InputArgList &Args) {
<< quote(rewritePath(Arg->getValue())) << "\n";
break;
default:
OS << Arg->getAsString(Args) << "\n";
OS << Arg->getSpelling();
if (Arg->getNumValues() > 0)
OS << " " << quote(Arg->getValue());
OS << "\n";
}
}
}

View File

@ -22,12 +22,14 @@
# RUN: diff %t.dir/build2/foo.o repro/%:t.dir/build2/foo.o
# RUN: touch file
# RUN: not ld.lld --reproduce repro2 'foo bar' -L"foo bar" -Lfile -version-script file
# RUN: not ld.lld --reproduce repro2 'foo bar' -L"foo bar" -Lfile -version-script file \
# RUN: --dynamic-linker "some unusual/path"
# RUN: FileCheck %s --check-prefix=RSP2 < repro2/response.txt
# RSP2: "foo bar"
# RSP2-NEXT: -L "foo bar"
# RSP2-NEXT: -L {{.+}}file
# RSP2-NEXT: -version-script {{.+}}file
# RSP2-NEXT: --dynamic-linker "some unusual/path"
# RUN: not ld.lld build1/foo.o -o bar -shared --as-needed --reproduce . 2>&1 \
# RUN: | FileCheck --check-prefix=ERROR %s