mirror of
https://github.com/llvm/llvm-project.git
synced 2025-04-19 10:56:44 +00:00
[ELF] -o -: suppress output if disableOutput
So that LLD_IN_TEST=2 ld.lld -o - a.o only writes the output once.
This commit is contained in:
parent
4f48048171
commit
c7579bfba5
@ -381,9 +381,11 @@ template <class ELFT> void Writer<ELFT>::run() {
|
||||
if (errCount(ctx))
|
||||
return;
|
||||
|
||||
if (auto e = buffer->commit())
|
||||
Err(ctx) << "failed to write output '" << buffer->getPath()
|
||||
<< "': " << std::move(e);
|
||||
if (!ctx.e.disableOutput) {
|
||||
if (auto e = buffer->commit())
|
||||
Err(ctx) << "failed to write output '" << buffer->getPath()
|
||||
<< "': " << std::move(e);
|
||||
}
|
||||
|
||||
if (!ctx.arg.cmseOutputLib.empty())
|
||||
writeARMCmseImportLib<ELFT>(ctx);
|
||||
|
@ -1,7 +1,8 @@
|
||||
# REQUIRES: x86
|
||||
|
||||
# RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %s -o %t.o
|
||||
# RUN: ld.lld %t.o -o - > %t1
|
||||
## Test that we only write to "-" once.
|
||||
# RUN: LLD_IN_TEST=2 ld.lld %t.o -o - > %t1
|
||||
# RUN: llvm-objdump -d %t1 | FileCheck %s
|
||||
|
||||
# CHECK: nop
|
||||
|
Loading…
x
Reference in New Issue
Block a user