diff options
author | James Henderson <jh7370@my.bristol.ac.uk> | 2019-12-20 13:51:18 +0000 |
---|---|---|
committer | James Henderson <jh7370@my.bristol.ac.uk> | 2020-01-02 17:16:18 +0000 |
commit | 3aeb741535235cb9cbfe2a84e50f52effed2d3ad (patch) | |
tree | 8972f53d006f472d06884492342b94266e6d96e6 | |
parent | 89d6c288ba5adb20d92142e9425f7ab79b8f159e (diff) | |
download | bcm5719-llvm-3aeb741535235cb9cbfe2a84e50f52effed2d3ad.tar.gz bcm5719-llvm-3aeb741535235cb9cbfe2a84e50f52effed2d3ad.zip |
[test][ELF] Verify debug line corruption messages are printed once
LLD warns if it encounters malformed debug data when parsing line
information for an undefined reference. We only want to warn once.
This patch adds additional checking to make sure the warnings are
printed only once, both for variables within the same program and
variables in later line programs.
Reviewed by: grimar, MaskRay
Differential Revision: https://reviews.llvm.org/D71759
-rw-r--r-- | lld/test/ELF/Inputs/undef-bad-debug.s | 26 | ||||
-rw-r--r-- | lld/test/ELF/undef.s | 13 |
2 files changed, 30 insertions, 9 deletions
diff --git a/lld/test/ELF/Inputs/undef-bad-debug.s b/lld/test/ELF/Inputs/undef-bad-debug.s index e3e9f5edb9d..d52710b2efd 100644 --- a/lld/test/ELF/Inputs/undef-bad-debug.s +++ b/lld/test/ELF/Inputs/undef-bad-debug.s @@ -1,7 +1,9 @@ .section .text,"ax" sym: - .quad zed6 + .quad zed6a sym2: + .quad zed6b +sym3: .quad zed7 .section .debug_line,"",@progbits @@ -32,6 +34,13 @@ sym2: .byte 1 # DW_LNS_copy .byte 2 # DW_LNS_advance_pc .byte 8 + .byte 0, 9, 2 # DW_LNE_set_address + .quad sym2 + .byte 3 # DW_LNS_advance_line + .byte 10 + .byte 1 # DW_LNS_copy + .byte 2 # DW_LNS_advance_pc + .byte 8 .byte 0, 1, 1 # DW_LNE_end_sequence .Lunit_end: @@ -55,7 +64,7 @@ sym2: .byte 0 .Lprologue2_end: .byte 0, 9, 2 # DW_LNE_set_address - .quad sym2 + .quad sym3 .byte 3 # DW_LNS_advance_line .byte 10 .byte 1 # DW_LNS_copy @@ -81,10 +90,15 @@ sym2: .byte 1 # Abbrev [1] 0xb:0x79 DW_TAG_compile_unit .long .Lunit # DW_AT_stmt_list .byte 2 # Abbrev [2] 0x2a:0x15 DW_TAG_variable - .long .Linfo_string # DW_AT_name + .long .Linfo_string0 # DW_AT_name # DW_AT_external .byte 1 # DW_AT_decl_file .byte 3 # DW_AT_decl_line + .byte 2 # Abbrev [2] 0x2a:0x15 DW_TAG_variable + .long .Linfo_string1 # DW_AT_name + # DW_AT_external + .byte 1 # DW_AT_decl_file + .byte 6 # DW_AT_decl_line .byte 0 # End Of Children Mark .Lcu_end: @@ -128,7 +142,9 @@ sym2: .byte 0 # EOM(3) .section .debug_str,"MS",@progbits,1 -.Linfo_string: +.Linfo_string0: .asciz "sym" -.Linfo2_string: +.Linfo_string1: .asciz "sym2" +.Linfo2_string: + .asciz "sym3" diff --git a/lld/test/ELF/undef.s b/lld/test/ELF/undef.s index f16bd4769b1..9be3f6bc134 100644 --- a/lld/test/ELF/undef.s +++ b/lld/test/ELF/undef.s @@ -5,8 +5,10 @@ # RUN: llvm-mc -filetype=obj -triple=x86_64-pc-linux %p/Inputs/undef-bad-debug.s -o %t4.o # RUN: rm -f %t2.a # RUN: llvm-ar rc %t2.a %t2.o -# RUN: not ld.lld %t.o %t2.a %t3.o %t4.o -o %t.exe 2>&1 | FileCheck %s -# RUN: not ld.lld -pie %t.o %t2.a %t3.o %t4.o -o %t.exe 2>&1 | FileCheck %s +# RUN: not ld.lld %t.o %t2.a %t3.o %t4.o -o %t.exe 2>&1 \ +# RUN: | FileCheck %s --implicit-check-not="error:" --implicit-check-not="warning:" +# RUN: not ld.lld -pie %t.o %t2.a %t3.o %t4.o -o %t.exe 2>&1 \ +# RUN: | FileCheck %s --implicit-check-not="error:" --implicit-check-not="warning:" # CHECK: error: undefined symbol: foo # CHECK: >>> referenced by undef.s @@ -46,16 +48,19 @@ # Show that all line table problems are mentioned as soon as the object's line information # is requested, even if that particular part of the line information is not currently required. +# Also show that the warnings are only printed once. # CHECK: warning: parsing line table prologue at 0x00000000 should have ended at 0x00000038 but it ended at 0x00000037 # CHECK: warning: last sequence in debug line table is not terminated! -# CHECK: error: undefined symbol: zed6 +# CHECK: error: undefined symbol: zed6a # CHECK: >>> referenced by {{.*}}tmp4.o:(.text+0x0) +# CHECK: error: undefined symbol: zed6b +# CHECK: >>> referenced by {{.*}}tmp4.o:(.text+0x8) # Show that a problem with one line table's information doesn't affect getting information from # a different one in the same object. # CHECK: error: undefined symbol: zed7 # CHECK: >>> referenced by undef-bad-debug2.s:11 (dir2{{/|\\}}undef-bad-debug2.s:11) -# CHECK: >>> {{.*}}tmp4.o:(.text+0x8) +# CHECK: >>> {{.*}}tmp4.o:(.text+0x10) # RUN: not ld.lld %t.o %t2.a -o %t.exe -no-demangle 2>&1 | \ # RUN: FileCheck -check-prefix=NO-DEMANGLE %s |