llvm-project/lld/test/ELF/undef-multi.s
Nico Weber 20eb719f99 lld: Reduce number of references to undefined printed from 10 to 3.
As of a while ago, lld groups all undefined references to a single
symbol in a single diagnostic. Back then, I made it so that we
print up to 10 references to each undefined symbol.

Having used this for a while, I never wished there were more
references, but I sometimes found that this can print a lot of
output. lld prints up to 10 diagnostics by default, and if
each has 10 references (which I've seen in practice), and each
undefined symbol produces 2 (possibly very long) lines of output,
that's over 200 lines of error output.

Let's try it with just 3 references for a while and see how
that feels in practice.

Differential Revision: https://reviews.llvm.org/D77017
2020-03-30 14:31:32 -04:00

56 lines
1.8 KiB
ArmAsm

# REQUIRES: x86
# RUN: llvm-mc -filetype=obj -triple=x86_64-pc-linux %s -o %t.o
# RUN: llvm-mc -filetype=obj -triple=x86_64-pc-linux %p/Inputs/undef.s -o %t2.o
# RUN: not ld.lld %t.o %t2.o -o /dev/null 2>&1 | FileCheck %s
# CHECK: error: undefined symbol: zed2
# CHECK-NEXT: >>> referenced by undef-multi.s
# CHECK-NEXT: >>> {{.*}}:(.text+0x1)
# CHECK-NEXT: >>> referenced by undef-multi.s
# CHECK-NEXT: >>> {{.*}}:(.text+0x6)
# CHECK-NEXT: >>> referenced by undef-multi.s
# CHECK-NEXT: >>> {{.*}}:(.text+0xB)
# CHECK-NEXT: >>> referenced 2 more times
# All references to a single undefined symbol count as a single error -- but
# at most 10 references are printed.
# RUN: echo ".globl _bar" > %t.moreref.s
# RUN: echo "_bar:" >> %t.moreref.s
# RUN: echo " call zed2" >> %t.moreref.s
# RUN: echo " call zed2" >> %t.moreref.s
# RUN: echo " call zed2" >> %t.moreref.s
# RUN: echo " call zed2" >> %t.moreref.s
# RUN: echo " call zed2" >> %t.moreref.s
# RUN: echo " call zed2" >> %t.moreref.s
# RUN: echo " call zed2" >> %t.moreref.s
# RUN: llvm-mc -filetype=obj -triple=x86_64-pc-linux %t.moreref.s -o %t3.o
# RUN: not ld.lld %t.o %t2.o %t3.o -o /dev/null -error-limit=2 2>&1 | \
# RUN: FileCheck --check-prefix=LIMIT %s
# LIMIT: error: undefined symbol: zed2
# LIMIT-NEXT: >>> referenced by undef-multi.s
# LIMIT-NEXT: >>> {{.*}}:(.text+0x1)
# LIMIT-NEXT: >>> referenced by undef-multi.s
# LIMIT-NEXT: >>> {{.*}}:(.text+0x6)
# LIMIT-NEXT: >>> referenced by undef-multi.s
# LIMIT-NEXT: >>> {{.*}}:(.text+0xB)
# LIMIT-NEXT: >>> referenced 9 more times
.file "undef-multi.s"
.globl _start
_start:
call zed2
.globl _f
_f:
call zed2
.globl _g
_g:
call zed2
.globl _h
_h:
call zed2