1 # RUN: llvm-mc -triple x86_64-pc-linux %s -filetype=obj -o - | llvm-dwarfdump -debug-names - | FileCheck %s
2 .section .debug_str,"MS",@progbits,1
8 # Fake .debug_info. We just need it for the offsets to two "compile units" and
10 .section .debug_info,"",@progbits
20 .section .debug_names,"",@progbits
21 .long .Lnames_end0-.Lnames_start0 # Header: contribution length
23 .short 5 # Header: version
24 .short 0 # Header: padding
25 .long 1 # Header: compilation unit count
26 .long 0 # Header: local type unit count
27 .long 0 # Header: foreign type unit count
28 .long 0 # Header: bucket count
29 .long 1 # Header: name count
30 .long .Lnames_abbrev_end0-.Lnames_abbrev_start0 # Header: abbreviation table size
31 .long 0 # Header: augmentation length
32 .long .Lcu_begin0 # Compilation unit 0
33 .long .Linfo_string0 # String 1: foo
34 .long .Lnames0-.Lnames_entries0 # Offset 1
35 .Lnames_abbrev_start0:
36 .byte 46 # Abbrev code
37 .byte 46 # DW_TAG_subprogram
38 .byte 3 # DW_IDX_die_offset
39 .byte 19 # DW_FORM_ref4
40 .byte 0 # End of abbrev
41 .byte 0 # End of abbrev
42 .byte 0 # End of abbrev list
46 .byte 46 # Abbrev code
47 .long .Ldie0-.Lcu_begin0 # DW_IDX_die_offset
48 .long 0 # End of list: foo
50 .byte 42 # Deliberately misalign the next contribution
53 .long .Lnames_end1-.Lnames_start1 # Header: contribution length
55 .short 5 # Header: version
56 .short 0 # Header: padding
57 .long 1 # Header: compilation unit count
58 .long 0 # Header: local type unit count
59 .long 0 # Header: foreign type unit count
60 .long 0 # Header: bucket count
61 .long 1 # Header: name count
62 .long .Lnames_abbrev_end1-.Lnames_abbrev_start1 # Header: abbreviation table size
63 .long 0 # Header: augmentation length
64 .long .Lcu_begin1 # Compilation unit 0
65 .long .Linfo_string1 # String 1: bar
66 .long .Lnames1-.Lnames_entries1 # Offset 1
67 .Lnames_abbrev_start1:
68 .byte 52 # Abbrev code
69 .byte 52 # DW_TAG_variable
70 .byte 3 # DW_IDX_die_offset
71 .byte 19 # DW_FORM_ref4
72 .byte 0 # End of abbrev
73 .byte 0 # End of abbrev
74 .byte 0 # End of abbrev list
78 .byte 52 # Abbrev code
79 .long .Ldie1-.Lcu_begin1 # DW_IDX_die_offset
80 .long 0 # End of list: bar
83 # CHECK: Name Index @ 0x0
85 # CHECK-NEXT: String: 0x00000000 "foo"
86 # CHECK-NEXT: Entry @ 0x37 {
87 # CHECK-NEXT: Abbrev: 0x2E
88 # CHECK-NEXT: Tag: DW_TAG_subprogram
89 # CHECK-NEXT: DW_IDX_die_offset: 0x00000001
93 # CHECK: Name Index @ 0x41
95 # CHECK-NEXT: String: 0x00000004 "bar"
96 # CHECK-NEXT: Entry @ 0x78 {
97 # CHECK-NEXT: Abbrev: 0x34
98 # CHECK-NEXT: Tag: DW_TAG_variable
99 # CHECK-NEXT: DW_IDX_die_offset: 0x00000001