Skip to content

Commit 05b7b6a

Browse files
committed
Test error
Created using spr 1.3.5-bogner
1 parent c551a07 commit 05b7b6a

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

lld/ELF/MarkLive.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -533,8 +533,8 @@ template <class ELFT> void elf::markLive(Ctx &ctx) {
533533
std::error_code ec;
534534
raw_fd_ostream os = ctx.openAuxiliaryFile(ctx.arg.printGcSections, ec);
535535
if (ec) {
536-
ErrAlways(ctx) << "--print-gc-sections=: cannot open "
537-
<< ctx.arg.printGcSections << ": " << ec.message();
536+
Err(ctx) << "cannot open --print-gc-sections= file "
537+
<< ctx.arg.printGcSections << ": " << ec.message();
538538
return;
539539
}
540540
for (InputSectionBase *sec : ctx.inputSections)

lld/test/ELF/gc-sections-print.s

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,10 @@
1616

1717
# NOPRINT-NOT: removing
1818

19+
# RUN: not ld.lld %t --gc-sections --print-gc-sections=/ -o %t2 2>&1 | FileCheck --check-prefix=ERR %s
20+
21+
# ERR: error: cannot open --print-gc-sections= file /: {{.*}}
22+
1923
.globl _start
2024
.protected a, x, y
2125
_start:

0 commit comments

Comments
 (0)