diff --git a/lld/test/ELF/Inputs/undef-bad-debug.s b/lld/test/ELF/Inputs/undef-bad-debug.s --- 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 @@ .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 @@ .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 @@ .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 @@ .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 --- 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