1 # RUN: llvm-mc -triple x86_64-unknown-linux %s -filetype=obj -o %t.o
2 # RUN: llvm-dwarfdump -v %t.o 2>&1 | FileCheck --check-prefix=OVERLAP %s
4 # Test object to verify that llvm-dwarfdump handles an invalid string offsets
5 # table with overlapping contributions.
7 .section .debug_str,"MS",@progbits,1
9 .asciz "Handmade DWARF producer"
11 .asciz "Compile_Unit_1"
13 .asciz "/home/test/CU1"
15 .asciz "Compile_Unit_2"
17 .asciz "/home/test/CU2"
23 .section .debug_str.dwo,"MS",@progbits,1
24 dwo_str_CU_5_producer
:
25 .asciz "Handmade split DWARF producer"
27 .asciz "V5_split_compile_unit"
28 dwo_str_CU_5_comp_dir
:
29 .asciz "/home/test/splitCU"
31 .asciz "V5_split_type_unit"
33 .asciz "V5_split_Mystruct"
35 # A rudimentary abbrev section.
36 .section .debug_abbrev,"",@progbits
37 .byte 0x01 # Abbrev code
38 .byte 0x11 # DW_TAG_compile_unit
39 .byte 0x00 # DW_CHILDREN_no
40 .byte 0x72 # DW_AT_str_offsets_base
41 .byte 0x17 # DW_FORM_sec_offset
46 .section .debug_info,"",@progbits
48 .long CU1_5_end-CU1_5_version # Length of Unit
50 .short 5 # DWARF version number
51 .byte 1 # DWARF Unit Type
52 .byte 8 # Address Size (in bytes)
53 .long .debug_abbrev # Offset Into Abbrev. Section
54 # A compile-unit DIE, which has no attributes.
55 .byte 1 # Abbreviation code
56 .long .debug_str_offsets_base0
60 .long CU2_5_end-CU2_5_version # Length of Unit
62 .short 5 # DWARF version number
63 .byte 1 # DWARF Unit Type
64 .byte 8 # Address Size (in bytes)
65 .long .debug_abbrev # Offset Into Abbrev. Section
66 # A compile-unit DIE, which has no attributes.
67 .byte 1 # Abbreviation code
68 .long .debug_str_offsets_base1
71 .section .debug_str_offsets,"",@progbits
73 .long .debug_str_offsets_segment1_end-.debug_str_offsets_base0+4
74 .short 5 # DWARF version
76 .debug_str_offsets_base0:
80 .debug_str_offsets_segment0_end:
82 # Overlapping with CU1's contribution
83 .long .debug_str_offsets_segment1_end-.debug_str_offsets_base1+4
84 .short 5 # DWARF version
86 .debug_str_offsets_base1:
90 .debug_str_offsets_segment1_end:
92 # OVERLAP: error: overlapping contributions to string offsets table in section .debug_str_offsets.