1# RUN: llvm-mc -triple x86_64-unknown-linux %s -filetype=obj -o %t.o 2# RUN: llvm-dwarfdump -v %t.o | FileCheck --check-prefix=INVALIDCONTRIB %s 3# 4# Test object to verify that llvm-dwarfdump handles an invalid string offsets 5# table. 6# 7# A rudimentary abbrev section. 8 .section .debug_abbrev,"",@progbits 9 .byte 0x01 # Abbrev code 10 .byte 0x11 # DW_TAG_compile_unit 11 .byte 0x00 # DW_CHILDREN_no 12 .byte 0x00 # EOM(1) 13 .byte 0x00 # EOM(2) 14 .byte 0x00 # EOM(3) 15 16# A rudimentary compile unit to convince dwarfdump that we are dealing with a 17# DWARF v5 string offsets table. 18 .section .debug_info,"",@progbits 19 20# DWARF v5 CU header. 21 .long CU1_5_end-CU1_5_version # Length of Unit 22CU1_5_version: 23 .short 5 # DWARF version number 24 .byte 1 # DWARF Unit Type 25 .byte 8 # Address Size (in bytes) 26 .long .debug_abbrev # Offset Into Abbrev. Section 27# A compile-unit DIE, which has no attributes. 28 .byte 1 # Abbreviation code 29CU1_5_end: 30 31 .section .debug_str_offsets,"",@progbits 32# A degenerate section, not enough for a single contribution size. 33 .byte 2 34 35# INVALIDCONTRIB: .debug_str_offsets contents: 36# INVALIDCONTRIB-NOT: contents: 37# INVALIDCONTRIB: error: invalid contribution to string offsets table in section .debug_str_offsets. 38