1 # RUN: llvm-mc %s -filetype obj -triple x86_64-pc-linux -dwarf-version=5 -o %t.o
2 # RUN: llvm-dwarfdump %t.o | FileCheck %s
3 # RUN: llvm-dwarfdump -verify %t.o
5 # CHECK: DW_AT_location (DW_OP_constu 0x7b, DW_OP_convert 0x0, DW_OP_stack_value)
9 .globl foo # -- Begin function foo
16 .loc 0 1 0 # const.c:1:0
19 .loc 0 3 1 prologue_end # const.c:3:1
23 .size foo, .Lfunc_end0-foo
26 .section .debug_abbrev,"",@progbits
27 .byte 1 # Abbreviation Code
28 .byte 17 # DW_TAG_compile_unit
29 .byte 1 # DW_CHILDREN_yes
30 .byte 37 # DW_AT_producer
31 .byte 37 # DW_FORM_strx1
32 .byte 19 # DW_AT_language
33 .byte 5 # DW_FORM_data2
35 .byte 37 # DW_FORM_strx1
36 .byte 114 # DW_AT_str_offsets_base
37 .byte 23 # DW_FORM_sec_offset
38 .byte 16 # DW_AT_stmt_list
39 .byte 23 # DW_FORM_sec_offset
40 .byte 27 # DW_AT_comp_dir
41 .byte 37 # DW_FORM_strx1
42 .byte 17 # DW_AT_low_pc
43 .byte 27 # DW_FORM_addrx
44 .byte 18 # DW_AT_high_pc
45 .byte 6 # DW_FORM_data4
46 .byte 115 # DW_AT_addr_base
47 .byte 23 # DW_FORM_sec_offset
50 .byte 2 # Abbreviation Code
51 .byte 46 # DW_TAG_subprogram
52 .byte 1 # DW_CHILDREN_yes
53 .byte 17 # DW_AT_low_pc
54 .byte 27 # DW_FORM_addrx
55 .byte 18 # DW_AT_high_pc
56 .byte 6 # DW_FORM_data4
57 .byte 64 # DW_AT_frame_base
58 .byte 24 # DW_FORM_exprloc
59 .byte 122 # DW_AT_call_all_calls
60 .byte 25 # DW_FORM_flag_present
62 .byte 37 # DW_FORM_strx1
63 .byte 58 # DW_AT_decl_file
64 .byte 11 # DW_FORM_data1
65 .byte 59 # DW_AT_decl_line
66 .byte 11 # DW_FORM_data1
67 .byte 63 # DW_AT_external
68 .byte 25 # DW_FORM_flag_present
71 .byte 3 # Abbreviation Code
72 .byte 52 # DW_TAG_variable
73 .byte 0 # DW_CHILDREN_no
74 .byte 2 # DW_AT_location
75 .byte 24 # DW_FORM_exprloc
77 .byte 37 # DW_FORM_strx1
78 .byte 58 # DW_AT_decl_file
79 .byte 11 # DW_FORM_data1
80 .byte 59 # DW_AT_decl_line
81 .byte 11 # DW_FORM_data1
83 .byte 19 # DW_FORM_ref4
86 .byte 4 # Abbreviation Code
87 .byte 36 # DW_TAG_base_type
88 .byte 0 # DW_CHILDREN_no
90 .byte 37 # DW_FORM_strx1
91 .byte 62 # DW_AT_encoding
92 .byte 11 # DW_FORM_data1
93 .byte 11 # DW_AT_byte_size
94 .byte 11 # DW_FORM_data1
98 .section .debug_info,"",@progbits
100 .long .Ldebug_info_end0-.Ldebug_info_start0 # Length of Unit
102 .short 5 # DWARF version number
103 .byte 1 # DWARF Unit Type
104 .byte 8 # Address Size (in bytes)
105 .long .debug_abbrev # Offset Into Abbrev. Section
106 .byte 1 # Abbrev [1] 0xc:0x36 DW_TAG_compile_unit
107 .byte 0 # DW_AT_producer
108 .short 12 # DW_AT_language
110 .long .Lstr_offsets_base0 # DW_AT_str_offsets_base
111 .long .Lline_table_start0 # DW_AT_stmt_list
112 .byte 2 # DW_AT_comp_dir
113 .byte 0 # DW_AT_low_pc
114 .long .Lfunc_end0-.Lfunc_begin0 # DW_AT_high_pc
115 .long .Laddr_table_base0 # DW_AT_addr_base
116 .byte 2 # Abbrev [2] 0x23:0x1a DW_TAG_subprogram
117 .byte 0 # DW_AT_low_pc
118 .long .Lfunc_end0-.Lfunc_begin0 # DW_AT_high_pc
119 .byte 1 # DW_AT_frame_base
121 # DW_AT_call_all_calls
123 .byte 0 # DW_AT_decl_file
124 .byte 1 # DW_AT_decl_line
126 .byte 3 # Abbrev [3] 0x2e:0xe DW_TAG_variable
127 .byte 5 # DW_AT_location
134 .byte 0 # DW_AT_decl_file
135 .byte 2 # DW_AT_decl_line
136 .long 61 # DW_AT_type
137 .byte 0 # End Of Children Mark
138 .byte 4 # Abbrev [4] 0x3d:0x4 DW_TAG_base_type
140 .byte 5 # DW_AT_encoding
141 .byte 4 # DW_AT_byte_size
142 .byte 0 # End Of Children Mark
144 .section .debug_str_offsets,"",@progbits
149 .section .debug_str,"MS",@progbits,1
151 .asciz "clang version 11.0.0" # string offset=0
153 .asciz "const.c" # string offset=21
155 .asciz "/" # string offset=29
157 .asciz "foo" # string offset=31
159 .asciz "local" # string offset=35
161 .asciz "int" # string offset=41
162 .section .debug_str_offsets,"",@progbits
169 .section .debug_addr,"",@progbits
170 .long .Ldebug_addr_end0-.Ldebug_addr_start0 # Length of contribution
172 .short 5 # DWARF version number
173 .byte 8 # Address size
174 .byte 0 # Segment selector size
178 .ident "clang version 11.0.0"
179 .section ".note.GNU-stack","",@progbits
180 .section .debug_line,"",@progbits