Handle "-" in tryCreateFile.

Otherwise we would fail with -M if the we didn't have write
permissions to the current directory.

llvm-svn: 317740
This commit is contained in:
Rafael Espindola 2017-11-08 23:07:32 +00:00
parent f6490e047a
commit 85b8d0ca7c
2 changed files with 3 additions and 1 deletions

View File

@ -80,5 +80,7 @@ void elf::unlinkAsync(StringRef Path) {
std::error_code elf::tryCreateFile(StringRef Path) {
if (Path.empty())
return std::error_code();
if (Path == "-")
return std::error_code();
return errorToErrorCode(FileOutputBuffer::create(Path, 1).takeError());
}

View File

@ -7,7 +7,7 @@
# RUN: mkdir -p %t.dir
# RUN: chmod 100 %t.dir
# RUN: cd %t.dir
# RUN: ld.lld %t.o -o %t.exe
# RUN: ld.lld %t.o -o %t.exe -M
# RUN: chmod 755 %t.dir
.globl _start