1 # RUN: llvm-mc -triple x86_64-pc-linux %s -filetype=obj -o %t
2 # RUN: llvm-dwarfdump -find=foo - <%t | FileCheck %s
4 # CHECK: 12: DW_TAG_subprogram
5 # CHECK-NEXT: DW_AT_name ("foo")
6 # CHECK-NEXT: DW_AT_external
7 # CHECK: 17: DW_TAG_subprogram
8 # CHECK-NEXT: DW_AT_name ("foo")
9 # CHECK-NEXT: DW_AT_external
11 .section .debug_str,"MS",@progbits,1
15 .asciz "Hand-written dwarf"
17 .section .debug_abbrev,"",@progbits
19 .byte 1 # Abbreviation Code
20 .byte 17 # DW_TAG_compile_unit
21 .byte 1 # DW_CHILDREN_yes
22 .byte 37 # DW_AT_producer
23 .byte 14 # DW_FORM_strp
24 .byte 19 # DW_AT_language
25 .byte 5 # DW_FORM_data2
28 .byte 2 # Abbreviation Code
29 .byte 46 # DW_TAG_subprogram
30 .byte 0 # DW_CHILDREN_no
32 .byte 14 # DW_FORM_strp
33 .byte 63 # DW_AT_external
34 .byte 25 # DW_FORM_flag_present
39 .section .debug_info,"",@progbits
41 .long .Lcu_end0-.Lcu_start0 # Length of Unit
43 .short 4 # DWARF version number
44 .long .Lsection_abbrev # Offset Into Abbrev. Section
45 .byte 8 # Address Size (in bytes)
46 .byte 1 # Abbrev [1] DW_TAG_compile_unit
47 .long .Lstring_producer # DW_AT_producer
48 .short 12 # DW_AT_language
50 .byte 2 # Abbrev [2] DW_TAG_subprogram
51 .long .Lstring_foo # DW_AT_name
54 .byte 2 # Abbrev [2] DW_TAG_subprogram
55 .long .Lstring_foo # DW_AT_name
57 .byte 0 # End Of Children Mark
60 .section .debug_names,"",@progbits
61 .long .Lnames_end0-.Lnames_start0 # Header: contribution length
63 .short 5 # Header: version
64 .short 0 # Header: padding
65 .long 1 # Header: compilation unit count
66 .long 0 # Header: local type unit count
67 .long 0 # Header: foreign type unit count
68 .long 0 # Header: bucket count
69 .long 1 # Header: name count
70 .long .Lnames_abbrev_end0-.Lnames_abbrev_start0 # Header: abbreviation table size
71 .long 0 # Header: augmentation length
72 .long .Lcu_begin0 # Compilation unit 0
73 .long .Lstring_foo # String in Bucket 0: foo
74 .long .Lnames0-.Lnames_entries0 # Offset in Bucket 0
75 .Lnames_abbrev_start0:
76 .byte 46 # Abbrev code
77 .byte 46 # DW_TAG_subprogram
78 .byte 3 # DW_IDX_die_offset
79 .byte 19 # DW_FORM_ref4
80 .byte 0 # End of abbrev
81 .byte 0 # End of abbrev
82 .byte 0 # End of abbrev list
86 .byte 46 # Abbrev code
87 .long .Ldie_foo-.Lcu_begin0 # DW_IDX_die_offset
88 .byte 46 # Abbrev code
89 .long .Ldie_foo2-.Lcu_begin0 # DW_IDX_die_offset
90 .long 0 # End of list: foo