[Alignment][NFC] Instructions::getLoadStoreAlignment
[llvm-complete.git] / test / tools / llvm-dwarfdump / X86 / debugloc.s
blob4e44e1c1a95fcda6cec76e9fb1feac54acdf460a
1 # RUN: llvm-mc %s -filetype obj -triple x86_64-linux-elf -o - \
2 # RUN: | llvm-dwarfdump --debug-loc - \
3 # RUN: | FileCheck %s
5 # RUN: llvm-mc %s -filetype obj -triple x86_64-linux-elf -o - \
6 # RUN: | llvm-dwarfdump --verify - \
7 # RUN: | FileCheck %s --check-prefix VERIFY
9 # CHECK: .debug_loc contents:
11 # CHECK: 0x00000000:
12 # CHECK-NEXT: [0x0000000000000000, 0x0000000000000003): DW_OP_reg5 RDI
13 # CHECK-NEXT: [0x0000000000000003, 0x0000000000000004): DW_OP_reg0 RAX
15 # CHECK: 0x00000036:
16 # CHECK-NEXT: [0x0000000000000010, 0x0000000000000013): DW_OP_reg5 RDI
17 # CHECK-NEXT: [0x0000000000000013, 0x0000000000000014): DW_OP_reg0 RAX
19 # VERIFY: Verifying .debug_info Unit Header Chain
20 # VERIFY-NOT: DIE has invalid DW_AT_location encoding
22 # Source:
23 # int* foo(int* i) { return i; }
24 # int* bar(int* i) { return i; }
25 # Compile with:
26 # clang -g -O3 test.c -S -o debugloc.s
28 .text
29 .file "test.c"
30 .globl foo
31 .align 16, 0x90
32 .type foo,@function
33 foo: # @foo
34 .Lfunc_begin0:
35 .file 1 "test.c"
36 .loc 1 1 0 # test.c:1:0
37 .cfi_startproc
38 # %bb.0:
39 #DEBUG_VALUE: foo:i <- %RDI
40 .loc 1 2 3 prologue_end # test.c:2:3
41 movq %rdi, %rax
42 .Ltmp0:
43 #DEBUG_VALUE: foo:i <- %RAX
44 retq
45 .Ltmp1:
46 .Lfunc_end0:
47 .size foo, .Lfunc_end0-foo
48 .cfi_endproc
50 .globl bar
51 .align 16, 0x90
52 .type bar,@function
53 bar: # @bar
54 .Lfunc_begin1:
55 .loc 1 5 0 # test.c:5:0
56 .cfi_startproc
57 # %bb.0:
58 #DEBUG_VALUE: bar:i <- %RDI
59 .loc 1 6 3 prologue_end # test.c:6:3
60 movq %rdi, %rax
61 .Ltmp2:
62 #DEBUG_VALUE: bar:i <- %RAX
63 retq
64 .Ltmp3:
65 .Lfunc_end1:
66 .size bar, .Lfunc_end1-bar
67 .cfi_endproc
69 .section .debug_str,"MS",@progbits,1
70 .Linfo_string0:
71 .asciz "clang version 3.8.0-2ubuntu4 (tags/RELEASE_380/final)" # string offset=0
72 .Linfo_string1:
73 .asciz "test.c" # string offset=54
74 .Linfo_string2:
75 .asciz "/tmp" # string offset=61
76 .Linfo_string3:
77 .asciz "foo" # string offset=66
78 .Linfo_string4:
79 .asciz "int" # string offset=70
80 .Linfo_string5:
81 .asciz "bar" # string offset=74
82 .Linfo_string6:
83 .asciz "i" # string offset=78
84 .section .debug_loc,"",@progbits
85 .Ldebug_loc0:
86 .quad .Lfunc_begin0-.Lfunc_begin0
87 .quad .Ltmp0-.Lfunc_begin0
88 .short 1 # Loc expr size
89 .byte 85 # DW_OP_reg5
90 .quad .Ltmp0-.Lfunc_begin0
91 .quad .Lfunc_end0-.Lfunc_begin0
92 .short 1 # Loc expr size
93 .byte 80 # DW_OP_reg0
94 .quad 0
95 .quad 0
96 .Ldebug_loc1:
97 .quad .Lfunc_begin1-.Lfunc_begin0
98 .quad .Ltmp2-.Lfunc_begin0
99 .short 1 # Loc expr size
100 .byte 85 # DW_OP_reg5
101 .quad .Ltmp2-.Lfunc_begin0
102 .quad .Lfunc_end1-.Lfunc_begin0
103 .short 1 # Loc expr size
104 .byte 80 # DW_OP_reg0
105 .quad 0
106 .quad 0
107 .section .debug_abbrev,"",@progbits
108 .Lsection_abbrev:
109 .byte 1 # Abbreviation Code
110 .byte 17 # DW_TAG_compile_unit
111 .byte 1 # DW_CHILDREN_yes
112 .byte 37 # DW_AT_producer
113 .byte 14 # DW_FORM_strp
114 .byte 19 # DW_AT_language
115 .byte 5 # DW_FORM_data2
116 .byte 3 # DW_AT_name
117 .byte 14 # DW_FORM_strp
118 .byte 16 # DW_AT_stmt_list
119 .byte 23 # DW_FORM_sec_offset
120 .byte 27 # DW_AT_comp_dir
121 .byte 14 # DW_FORM_strp
122 .ascii "\341\177" # DW_AT_APPLE_optimized
123 .byte 25 # DW_FORM_flag_present
124 .byte 17 # DW_AT_low_pc
125 .byte 1 # DW_FORM_addr
126 .byte 18 # DW_AT_high_pc
127 .byte 6 # DW_FORM_data4
128 .byte 0 # EOM(1)
129 .byte 0 # EOM(2)
130 .byte 2 # Abbreviation Code
131 .byte 46 # DW_TAG_subprogram
132 .byte 1 # DW_CHILDREN_yes
133 .byte 17 # DW_AT_low_pc
134 .byte 1 # DW_FORM_addr
135 .byte 18 # DW_AT_high_pc
136 .byte 6 # DW_FORM_data4
137 .ascii "\347\177" # DW_AT_APPLE_omit_frame_ptr
138 .byte 25 # DW_FORM_flag_present
139 .byte 64 # DW_AT_frame_base
140 .byte 24 # DW_FORM_exprloc
141 .byte 3 # DW_AT_name
142 .byte 14 # DW_FORM_strp
143 .byte 58 # DW_AT_decl_file
144 .byte 11 # DW_FORM_data1
145 .byte 59 # DW_AT_decl_line
146 .byte 11 # DW_FORM_data1
147 .byte 39 # DW_AT_prototyped
148 .byte 25 # DW_FORM_flag_present
149 .byte 73 # DW_AT_type
150 .byte 19 # DW_FORM_ref4
151 .byte 63 # DW_AT_external
152 .byte 25 # DW_FORM_flag_present
153 .ascii "\341\177" # DW_AT_APPLE_optimized
154 .byte 25 # DW_FORM_flag_present
155 .byte 0 # EOM(1)
156 .byte 0 # EOM(2)
157 .byte 3 # Abbreviation Code
158 .byte 5 # DW_TAG_formal_parameter
159 .byte 0 # DW_CHILDREN_no
160 .byte 2 # DW_AT_location
161 .byte 23 # DW_FORM_sec_offset
162 .byte 3 # DW_AT_name
163 .byte 14 # DW_FORM_strp
164 .byte 58 # DW_AT_decl_file
165 .byte 11 # DW_FORM_data1
166 .byte 59 # DW_AT_decl_line
167 .byte 11 # DW_FORM_data1
168 .byte 73 # DW_AT_type
169 .byte 19 # DW_FORM_ref4
170 .byte 0 # EOM(1)
171 .byte 0 # EOM(2)
172 .byte 4 # Abbreviation Code
173 .byte 15 # DW_TAG_pointer_type
174 .byte 0 # DW_CHILDREN_no
175 .byte 73 # DW_AT_type
176 .byte 19 # DW_FORM_ref4
177 .byte 0 # EOM(1)
178 .byte 0 # EOM(2)
179 .byte 5 # Abbreviation Code
180 .byte 36 # DW_TAG_base_type
181 .byte 0 # DW_CHILDREN_no
182 .byte 3 # DW_AT_name
183 .byte 14 # DW_FORM_strp
184 .byte 62 # DW_AT_encoding
185 .byte 11 # DW_FORM_data1
186 .byte 11 # DW_AT_byte_size
187 .byte 11 # DW_FORM_data1
188 .byte 0 # EOM(1)
189 .byte 0 # EOM(2)
190 .byte 0 # EOM(3)
191 .section .debug_info,"",@progbits
192 .Lsection_info:
193 .Lcu_begin0:
194 .long 133 # Length of Unit
195 .short 4 # DWARF version number
196 .long .Lsection_abbrev # Offset Into Abbrev. Section
197 .byte 8 # Address Size (in bytes)
198 .byte 1 # Abbrev [1] 0xb:0x7e DW_TAG_compile_unit
199 .long .Linfo_string0 # DW_AT_producer
200 .short 12 # DW_AT_language
201 .long .Linfo_string1 # DW_AT_name
202 .long .Lline_table_start0 # DW_AT_stmt_list
203 .long .Linfo_string2 # DW_AT_comp_dir
204 # DW_AT_APPLE_optimized
205 .quad .Lfunc_begin0 # DW_AT_low_pc
206 .long .Lfunc_end1-.Lfunc_begin0 # DW_AT_high_pc
207 .byte 2 # Abbrev [2] 0x2a:0x29 DW_TAG_subprogram
208 .quad .Lfunc_begin0 # DW_AT_low_pc
209 .long .Lfunc_end0-.Lfunc_begin0 # DW_AT_high_pc
210 # DW_AT_APPLE_omit_frame_ptr
211 .byte 1 # DW_AT_frame_base
212 .byte 87
213 .long .Linfo_string3 # DW_AT_name
214 .byte 1 # DW_AT_decl_file
215 .byte 1 # DW_AT_decl_line
216 # DW_AT_prototyped
217 .long 124 # DW_AT_type
218 # DW_AT_external
219 # DW_AT_APPLE_optimized
220 .byte 3 # Abbrev [3] 0x43:0xf DW_TAG_formal_parameter
221 .long .Ldebug_loc0 # DW_AT_location
222 .long .Linfo_string6 # DW_AT_name
223 .byte 1 # DW_AT_decl_file
224 .byte 1 # DW_AT_decl_line
225 .long 124 # DW_AT_type
226 .byte 0 # End Of Children Mark
227 .byte 2 # Abbrev [2] 0x53:0x29 DW_TAG_subprogram
228 .quad .Lfunc_begin1 # DW_AT_low_pc
229 .long .Lfunc_end1-.Lfunc_begin1 # DW_AT_high_pc
230 # DW_AT_APPLE_omit_frame_ptr
231 .byte 1 # DW_AT_frame_base
232 .byte 87
233 .long .Linfo_string5 # DW_AT_name
234 .byte 1 # DW_AT_decl_file
235 .byte 5 # DW_AT_decl_line
236 # DW_AT_prototyped
237 .long 124 # DW_AT_type
238 # DW_AT_external
239 # DW_AT_APPLE_optimized
240 .byte 3 # Abbrev [3] 0x6c:0xf DW_TAG_formal_parameter
241 .long .Ldebug_loc1 # DW_AT_location
242 .long .Linfo_string6 # DW_AT_name
243 .byte 1 # DW_AT_decl_file
244 .byte 5 # DW_AT_decl_line
245 .long 124 # DW_AT_type
246 .byte 0 # End Of Children Mark
247 .byte 4 # Abbrev [4] 0x7c:0x5 DW_TAG_pointer_type
248 .long 129 # DW_AT_type
249 .byte 5 # Abbrev [5] 0x81:0x7 DW_TAG_base_type
250 .long .Linfo_string4 # DW_AT_name
251 .byte 5 # DW_AT_encoding
252 .byte 4 # DW_AT_byte_size
253 .byte 0 # End Of Children Mark
254 .section .debug_ranges,"",@progbits
255 .Ldebug_range:
256 .section .debug_macinfo,"",@progbits
257 .byte 0 # End Of Macro List Mark
258 .section .debug_pubnames,"",@progbits
259 .long .LpubNames_end0-.LpubNames_begin0 # Length of Public Names Info
260 .LpubNames_begin0:
261 .short 2 # DWARF Version
262 .long .Lcu_begin0 # Offset of Compilation Unit Info
263 .long 137 # Compilation Unit Length
264 .long 42 # DIE offset
265 .asciz "foo" # External Name
266 .long 83 # DIE offset
267 .asciz "bar" # External Name
268 .long 0 # End Mark
269 .LpubNames_end0:
270 .section .debug_pubtypes,"",@progbits
271 .long .LpubTypes_end0-.LpubTypes_begin0 # Length of Public Types Info
272 .LpubTypes_begin0:
273 .short 2 # DWARF Version
274 .long .Lcu_begin0 # Offset of Compilation Unit Info
275 .long 137 # Compilation Unit Length
276 .long 129 # DIE offset
277 .asciz "int" # External Name
278 .long 0 # End Mark
279 .LpubTypes_end0:
281 .ident "clang version 3.8.0-2ubuntu4 (tags/RELEASE_380/final)"
282 .section ".note.GNU-stack","",@progbits
283 .section .debug_line,"",@progbits
284 .Lline_table_start0: