1 # RUN: llc %s -o - -experimental-debug-variable-locations=true \
2 # RUN: -run-pass=livedebugvalues \
3 # RUN: | FileCheck %s --implicit-check-not=DBG_VALUE
4 # RUN: llc %s -o - -experimental-debug-variable-locations=true \
5 # RUN: -start-before=livedebugvalues -filetype=obj \
6 # RUN: | llvm-dwarfdump - | FileCheck %s --check-prefix=DWARF
8 # LLVM can produce DIExpressions that convert from one value of arbitrary size
9 # to another. This is normally fine, however that means the value for a
10 # variable tracked in instruction referencing might not be the same size as the
13 # This becomes a problem when values move onto the stack and we emit
14 # DW_OP_deref: there is no information about how large a value the consumer
15 # should load from the stack. The convention today appears to be the size of
16 # the variable, and as a result if you have a value that's smaller than the
17 # variable size, extra information is loaded onto the DWARF expression stack.
18 # This then appears as a false variable value to the consumer.
20 # In this test, there are various scenarios to test where the size of the value
21 # needs to reach the expression emitter in LiveDebugValues. However, there are
22 # even more scenarios to consider where the value is in a spill slot, and:
23 # * The value is larger than the variable, the same, or smaller,
24 # * The variable is a normal scalar, or a fragment,
25 # * There is a DW_OP_stack_value in the expression, or not
26 # That gives us twelve situations to consider, and the easiest way to confirm
27 # correctness is to write them all out. The final DWARF expressions to
31 # * Larger value (64 bits)
32 # DW_OP_breg7 RSP-8, DW_OP_deref_size 0x8, DW_OP_stack_value
33 # * Same value (32 bits)
35 # * Smaller value (8 bits)
36 # DW_OP_breg7 RSP-8, DW_OP_deref_size 0x1, DW_OP_stack_value
37 # * Fragment (32 bits)
38 # * Larger value (64 bits)
39 # DW_OP_breg7 RSP-8, DW_OP_deref_size 0x8, DW_OP_stack_value, DW_OP_piece 0x4
40 # * Same value (32 bits)
41 # DW_OP_breg7 RSP-8, DW_OP_piece 0x4
42 # * Smaller value (8 bits)
43 # DW_OP_breg7 RSP-8, DW_OP_deref_size 0x1, DW_OP_stack_value, DW_OP_piece 0x4
44 # * Stack value (imagine there was some arithmetic on the stack before the
45 # DW_OP_stack_value opcode),
47 # * Larger value (64 bits)
48 # DW_OP_breg7 RSP-8, DW_OP_deref_size 0x8, DW_OP_stack_value
49 # * Same value (32 bits)
50 # DW_OP_breg7 RSP-8, DW_OP_deref, DW_OP_stack_value
51 # * Smaller value (8 bits)
52 # DW_OP_breg7 RSP-8, DW_OP_deref_size 0x1, DW_OP_stack_value
53 # * Fragment (32 bits)
54 # * Larger value (64 bits)
55 # DW_OP_breg7 RSP-8, DW_OP_deref_size 0x8, DW_OP_stack_value, DW_OP_piece 0x4
56 # * Same value (32 bits)
57 # DW_OP_breg7 RSP-8, DW_OP_deref_size 0x4, DW_OP_stack_value, DW_OP_piece 0x4
58 # * Smaller value (8 bits)
59 # DW_OP_breg7 RSP-8, DW_OP_deref_size 0x1, DW_OP_stack_value, DW_OP_piece 0x4
61 # The outlier from the pattern is (Stack value, Fragment, Same value size): we
62 # put a DW_OP_deref_size in where a DW_OP_deref could have sufficied. However,
63 # if we used DW_OP_deref, it would force the consumer to derive the deref size
64 # from the DW_OP_piece, which is un-necessarily hard.
66 ## Capture variable num,
67 # CHECK-DAG: ![[VARNUM:[0-9]+]] = !DILocalVariable(name: "flannel",
68 # CHECK-DAG: ![[VARNUM2:[0-9]+]] = !DILocalVariable(name: "shoes",
70 # DWARF: DW_TAG_variable
71 # DWARF-NEXT: DW_AT_location
72 ## Defined in register, spilt to stack.
73 # DWARF-NEXT: DW_OP_breg0 RAX+0, DW_OP_constu 0xff, DW_OP_and, DW_OP_convert (0x00000026) "DW_ATE_signed_8", DW_OP_convert (0x0000002a) "DW_ATE_signed_32", DW_OP_stack_value
74 # DWARF-NEXT: DW_OP_breg7 RSP-8, DW_OP_deref_size 0x1, DW_OP_convert (0x00000026) "DW_ATE_signed_8", DW_OP_convert (0x0000002a) "DW_ATE_signed_32", DW_OP_stack_value
76 # DWARF-NEXT: DW_OP_breg7 RSP-8, DW_OP_deref_size 0x1, DW_OP_convert (0x00000026) "DW_ATE_signed_8", DW_OP_convert (0x0000002a) "DW_ATE_signed_32", DW_OP_stack_value
77 ## DBG_PHI that moves to stack.
78 # DWARF-NEXT: DW_OP_breg7 RSP-8, DW_OP_deref_size 0x1, DW_OP_stack_value
79 ## DBG_PHI of stack with size.
80 # DWARF-NEXT: DW_OP_breg7 RSP-8, DW_OP_deref_size 0x2, DW_OP_stack_value
81 ## Followed by scalar / no-stack-value locations with various sizes.
82 # DWARF-NEXT: DW_OP_breg7 RSP-8, DW_OP_deref_size 0x8, DW_OP_stack_value
83 # DWARF-NEXT: DW_OP_breg7 RSP-8
84 # DWARF-NEXT: DW_OP_breg7 RSP-8, DW_OP_deref_size 0x1, DW_OP_stack_value
85 ## scalar / stack value with various sizes.
86 # DWARF-NEXT: DW_OP_breg7 RSP-8, DW_OP_deref_size 0x8, DW_OP_lit1, DW_OP_plus, DW_OP_stack_value
87 # DWARF-NEXT: DW_OP_breg7 RSP-8, DW_OP_deref, DW_OP_lit1, DW_OP_plus, DW_OP_stack_value
88 # DWARF-NEXT: DW_OP_breg7 RSP-8, DW_OP_deref_size 0x1, DW_OP_lit1, DW_OP_plus, DW_OP_stack_value)
89 # DWARF: DW_AT_name ("flannel")
91 # Variable with fragments.
92 # DWARF: DW_TAG_variable
93 # DWARF-NEXT: DW_AT_location
94 ## Scalar / no-stack-value locations with various sizes.
95 # DWARF-NEXT: DW_OP_breg7 RSP-8, DW_OP_deref_size 0x8, DW_OP_stack_value, DW_OP_piece 0x4
96 # DWARF-NEXT: DW_OP_breg7 RSP-8, DW_OP_piece 0x4
97 # DWARF-NEXT: DW_OP_breg7 RSP-8, DW_OP_deref_size 0x1, DW_OP_stack_value, DW_OP_piece 0x4
98 ## Scalar / stack value with various sizes.
99 # DWARF-NEXT: DW_OP_breg7 RSP-8, DW_OP_deref_size 0x8, DW_OP_lit1, DW_OP_plus, DW_OP_stack_value, DW_OP_piece 0x4
100 # DWARF-NEXT: DW_OP_breg7 RSP-8, DW_OP_deref_size 0x4, DW_OP_lit1, DW_OP_plus, DW_OP_stack_value, DW_OP_piece 0x4
101 # DWARF-NEXT: DW_OP_breg7 RSP-8, DW_OP_deref_size 0x1, DW_OP_lit1, DW_OP_plus, DW_OP_stack_value, DW_OP_piece 0x4)
102 # DWARF: DW_AT_name ("shoes")
105 ; ModuleID = 'missingvar.ll'
106 source_filename = "a"
107 target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
108 target triple = "x86_64-unknown-linux-gnu"
110 define linkonce_odr void @_ZNSt5dequeIPN4llvm4LoopESaIS2_EE13_M_insert_auxESt15_Deque_iteratorIS2_RS2_PS2_EmRKS2_() local_unnamed_addr align 2 !dbg !3 {
112 call void @llvm.dbg.value(metadata i32 0, metadata !8, metadata !DIExpression()), !dbg !7
113 call void @llvm.dbg.value(metadata i32 0, metadata !10, metadata !DIExpression()), !dbg !7
117 declare void @llvm.dbg.value(metadata, metadata, metadata)
119 !llvm.module.flags = !{!0, !9}
122 !0 = !{i32 2, !"Debug Info Version", i32 3}
123 !1 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !2, producer: "beards", isOptimized: true, runtimeVersion: 4, emissionKind: FullDebug)
124 !2 = !DIFile(filename: "bees.cpp", directory: "")
125 !3 = distinct !DISubprogram(name: "nope", scope: !2, file: !2, line: 1, type: !4, spFlags: DISPFlagDefinition, unit: !1)
126 !4 = !DISubroutineType(types: !5)
128 !6 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed)
129 !7 = !DILocation(line: 1, scope: !3)
130 !8 = !DILocalVariable(name: "flannel", scope: !3, type: !6)
131 !9 = !{i32 2, !"Dwarf Version", i32 5}
132 !10 = !DILocalVariable(name: "shoes", scope: !3, type: !11)
133 !11 = !DIBasicType(name: "long", size: 64, encoding: DW_ATE_signed)
138 name: _ZNSt5dequeIPN4llvm4LoopESaIS2_EE13_M_insert_auxESt15_Deque_iteratorIS2_RS2_PS2_EmRKS2_
140 tracksRegLiveness: true
148 offsetAdjustment: -48
151 cvBytesOfCalleeSavedRegisters: 48
153 - { id: 0, type: spill-slot, offset: -56, size: 8, alignment: 8, callee-saved-register: '$rbx' }
154 - { id: 1, type: spill-slot, offset: -48, size: 8, alignment: 16, callee-saved-register: '$r12' }
155 - { id: 2, type: spill-slot, offset: -40, size: 8, alignment: 8, callee-saved-register: '$r13' }
156 - { id: 3, type: spill-slot, offset: -32, size: 8, alignment: 16, callee-saved-register: '$r14' }
157 - { id: 4, type: spill-slot, offset: -24, size: 8, alignment: 8, callee-saved-register: '$r15' }
158 - { id: 5, type: spill-slot, offset: -16, size: 8, alignment: 16, callee-saved-register: '$rbp' }
160 - { id: 0, type: spill-slot, offset: -64, size: 8, alignment: 8 }
161 machineFunctionInfo: {}
164 liveins: $rdi, $rdx, $rsi, $rbp, $r15, $r14, $r13, $r12, $rbx
166 ; CHECK-LABEL: bb.0.entry:
168 ;; PART ONE: For this first block of tests, check that information about
169 ;; the size of the value on the stack makes it through to the expression.
171 $al = MOV8ri 0, debug-instr-number 1, debug-location !7
172 DBG_INSTR_REF !8, !DIExpression(DW_OP_LLVM_arg, 0, DW_OP_LLVM_convert, 8, DW_ATE_signed, DW_OP_LLVM_convert, 32, DW_ATE_signed, DW_OP_stack_value), dbg-instr-ref(1, 0), debug-location !7
173 ; CHECK: DBG_VALUE_LIST ![[VARNUM]],
174 ; CHECK-SAME: !DIExpression(DW_OP_LLVM_arg, 0, DW_OP_LLVM_convert, 8, DW_ATE_signed,
175 ; CHECK-SAME : DW_OP_LLVM_convert, 32, DW_ATE_signed, DW_OP_stack_value), $al
177 MOV8mr $rsp, 1, $noreg, -8, $noreg, renamable $al :: (store 1 into %stack.0)
178 ;; Clobber to force variable location onto stack. We should use a
179 ;; deref_size 1 because the value is smaller than the variable.
180 $al = MOV8ri 0, debug-location !7
181 ; CHECK: DBG_VALUE_LIST ![[VARNUM]],
182 ; CHECK-SAME: !DIExpression(DW_OP_LLVM_arg, 0, DW_OP_constu, 8, DW_OP_minus,
183 ; CHECK-SAME: DW_OP_deref_size, 1, DW_OP_LLVM_convert, 8, DW_ATE_signed,
184 ; CHECK-SAME: DW_OP_LLVM_convert, 32, DW_ATE_signed, DW_OP_stack_value), $rsp
186 ; Terminate the current variable location,
187 DBG_VALUE $noreg, $noreg, !8, !DIExpression(), debug-location !7
188 ; CHECK: DBG_VALUE $noreg, $noreg, ![[VARNUM]], !DIExpression()
190 ;; Try again, but with the value originating on the stack, to ensure that
191 ;; we can find its size. It should be deref_size 1 again.
192 INC8m $rsp, 1, $noreg, 4, $noreg, implicit-def dead $eflags, debug-instr-number 2, debug-location !7 :: (store (s8) into %stack.0)
193 DBG_INSTR_REF !8, !DIExpression(DW_OP_LLVM_arg, 0, DW_OP_LLVM_convert, 8, DW_ATE_signed, DW_OP_LLVM_convert, 32, DW_ATE_signed, DW_OP_stack_value), dbg-instr-ref(2, 1000000), debug-location !7
194 ; CHECK: DBG_VALUE_LIST ![[VARNUM]],
195 ; CHECK-SAME: !DIExpression(DW_OP_LLVM_arg, 0, DW_OP_constu, 8, DW_OP_minus,
196 ; CHECK-SAME: DW_OP_deref_size, 1, DW_OP_LLVM_convert, 8, DW_ATE_signed,
197 ; CHECK-SAME: DW_OP_LLVM_convert, 32, DW_ATE_signed, DW_OP_stack_value), $rsp
199 $eax = MOV32ri 0, debug-location !7
201 ;; How about DBG_PHIs? The size of the value is communicated by the register
202 ;; size, or an extra DBG_PHI operand, and that should feed through into the
203 ;; decision of whether to deref_size or not.
205 DBG_VALUE $noreg, $noreg, !8, !DIExpression(), debug-location !7
206 ; CHECK: DBG_VALUE $noreg
208 $al = MOV8ri 0, debug-location !7
211 MOV32mr $rsp, 1, $noreg, -8, $noreg, renamable $eax :: (store 4 into %stack.0)
212 $eax = MOV32ri 0, debug-location !7
213 DBG_INSTR_REF !8, !DIExpression(DW_OP_LLVM_arg, 0), dbg-instr-ref(7, 0), debug-location !7
214 ; CHECK: DBG_VALUE_LIST ![[VARNUM]],
215 ; CHECK-SAME: !DIExpression(DW_OP_LLVM_arg, 0, DW_OP_constu, 8, DW_OP_minus, DW_OP_deref_size, 1, DW_OP_stack_value), $rsp
217 $eax = MOV32ri 0, debug-location !7
219 ;; And for when the DBG_PHI specifies a stack size...
220 DBG_PHI %stack.0, 8, 16
221 DBG_INSTR_REF !8, !DIExpression(DW_OP_LLVM_arg, 0), dbg-instr-ref(8, 0), debug-location !7
222 ; CHECK: DBG_VALUE_LIST ![[VARNUM]],
223 ; CHECK-SAME: !DIExpression(DW_OP_LLVM_arg, 0, DW_OP_constu, 8, DW_OP_minus, DW_OP_deref_size, 2, DW_OP_stack_value), $rsp
225 $eax = MOV32ri 0, debug-location !7
226 DBG_VALUE $noreg, $noreg, !8, !DIExpression(), debug-location !7
227 ; CHECK: DBG_VALUE $noreg, $noreg
228 DBG_VALUE $noreg, $noreg, !10, !DIExpression(DW_OP_LLVM_fragment, 0, 32), debug-location !7
229 ; CHECK: DBG_VALUE $noreg, $noreg
231 ;; PART TWO: test the twelve kinds of location expression mentioned in the
232 ;; opening comment of this test, in that order. Please update the opening
233 ;; comment, these lines and the DWARF check lines at the same time.
234 ;; In each test we'll state a location, give it an instruction to cover,
235 ;; and then terminate it.
237 ;; Scalar (32), Large value (64), no stack value,
238 $rax = MOV64ri 0, debug-instr-number 10, debug-location !7
239 MOV64mr $rsp, 1, $noreg, -8, $noreg, renamable $rax :: (store 8 into %stack.0)
240 $rax = MOV64ri 0, debug-location !7
241 DBG_INSTR_REF !8, !DIExpression(DW_OP_LLVM_arg, 0), dbg-instr-ref(10, 0), debug-location !7
242 ; CHECK: DBG_VALUE_LIST ![[VARNUM]],
243 ; CHECK-SAME: !DIExpression(DW_OP_LLVM_arg, 0, DW_OP_constu, 8, DW_OP_minus, DW_OP_deref_size, 8, DW_OP_stack_value), $rsp
244 $eax = MOV32ri 0, debug-location !7
245 DBG_VALUE $noreg, $noreg, !8, !DIExpression(), debug-location !7
246 ; CHECK: DBG_VALUE $noreg, $noreg
248 ;; Scalar (32), Same value size (32), no stack value,
249 $eax = MOV32ri 0, debug-instr-number 11, debug-location !7
250 MOV32mr $rsp, 1, $noreg, -8, $noreg, renamable $eax :: (store 4 into %stack.0)
251 $rax = MOV64ri 0, debug-location !7
252 DBG_INSTR_REF !8, !DIExpression(DW_OP_LLVM_arg, 0), dbg-instr-ref(11, 0), debug-location !7
253 ; CHECK: DBG_VALUE_LIST ![[VARNUM]],
254 ; CHECK-SAME: !DIExpression(DW_OP_LLVM_arg, 0, DW_OP_constu, 8, DW_OP_minus, DW_OP_deref), $rsp
255 $eax = MOV32ri 0, debug-location !7
256 DBG_VALUE $noreg, $noreg, !8, !DIExpression(), debug-location !7
257 ; CHECK: DBG_VALUE $noreg, $noreg
259 ;; Scalar (32), Smaller value (8), no stack value,
260 $al = MOV8ri 0, debug-instr-number 12, debug-location !7
261 MOV8mr $rsp, 1, $noreg, -8, $noreg, renamable $al :: (store 1 into %stack.0)
262 $rax = MOV64ri 0, debug-location !7
263 DBG_INSTR_REF !8, !DIExpression(DW_OP_LLVM_arg, 0), dbg-instr-ref(12, 0), debug-location !7
264 ; CHECK: DBG_VALUE_LIST ![[VARNUM]],
265 ; CHECK-SAME: !DIExpression(DW_OP_LLVM_arg, 0, DW_OP_constu, 8, DW_OP_minus, DW_OP_deref_size, 1, DW_OP_stack_value), $rsp
266 $eax = MOV32ri 0, debug-location !7
267 DBG_VALUE $noreg, $noreg, !8, !DIExpression(), debug-location !7
268 ; CHECK: DBG_VALUE $noreg, $noreg
270 ;; Fragment (32), Larger value (64), no stack value,
271 $rax = MOV64ri 0, debug-instr-number 13, debug-location !7
272 MOV64mr $rsp, 1, $noreg, -8, $noreg, renamable $rax :: (store 8 into %stack.0)
273 $rax = MOV64ri 0, debug-location !7
274 DBG_INSTR_REF !10, !DIExpression(DW_OP_LLVM_arg, 0, DW_OP_LLVM_fragment, 0, 32), dbg-instr-ref(13, 0), debug-location !7
275 ; CHECK: DBG_VALUE_LIST ![[VARNUM2]],
276 ; CHECK-SAME: !DIExpression(DW_OP_LLVM_arg, 0, DW_OP_constu, 8, DW_OP_minus, DW_OP_deref_size, 8, DW_OP_stack_value, DW_OP_LLVM_fragment, 0, 32), $rsp
277 $eax = MOV32ri 0, debug-location !7
278 DBG_VALUE $noreg, $noreg, !10, !DIExpression(DW_OP_LLVM_fragment, 0, 32), debug-location !7
279 ; CHECK: DBG_VALUE $noreg, $noreg
281 ;; Fragment (32), Same value size (32), no stack value,
282 $eax = MOV32ri 0, debug-instr-number 14, debug-location !7
283 MOV32mr $rsp, 1, $noreg, -8, $noreg, renamable $eax :: (store 4 into %stack.0)
284 $rax = MOV64ri 0, debug-location !7
285 DBG_INSTR_REF !10, !DIExpression(DW_OP_LLVM_arg, 0, DW_OP_LLVM_fragment, 0, 32), dbg-instr-ref(14, 0), debug-location !7
286 ; CHECK: DBG_VALUE_LIST ![[VARNUM2]],
287 ; CHECK-SAME: !DIExpression(DW_OP_LLVM_arg, 0, DW_OP_constu, 8, DW_OP_minus, DW_OP_deref, DW_OP_LLVM_fragment, 0, 32), $rsp
288 $eax = MOV32ri 0, debug-location !7
289 DBG_VALUE $noreg, $noreg, !10, !DIExpression(DW_OP_LLVM_fragment, 0, 32), debug-location !7
290 ; CHECK: DBG_VALUE $noreg, $noreg
292 ;; Fragment (32), Smaller value (8), no stack value,
293 $al = MOV8ri 0, debug-instr-number 15, debug-location !7
294 MOV8mr $rsp, 1, $noreg, -8, $noreg, renamable $al :: (store 1 into %stack.0)
295 $rax = MOV64ri 0, debug-location !7
296 DBG_INSTR_REF !10, !DIExpression(DW_OP_LLVM_arg, 0, DW_OP_LLVM_fragment, 0, 32), dbg-instr-ref(15, 0), debug-location !7
297 ; CHECK: DBG_VALUE_LIST ![[VARNUM2]],
298 ; CHECK-SAME: !DIExpression(DW_OP_LLVM_arg, 0, DW_OP_constu, 8, DW_OP_minus, DW_OP_deref_size, 1, DW_OP_stack_value, DW_OP_LLVM_fragment, 0, 32), $rsp
299 $eax = MOV32ri 0, debug-location !7
300 DBG_VALUE $noreg, $noreg, !10, !DIExpression(DW_OP_LLVM_fragment, 0, 32), debug-location !7
301 ; CHECK: DBG_VALUE $noreg, $noreg
305 ;; Scalar (32), Large value (64), with stack value,
306 $rax = MOV64ri 0, debug-instr-number 16, debug-location !7
307 MOV64mr $rsp, 1, $noreg, -8, $noreg, renamable $rax :: (store 8 into %stack.0)
308 $rax = MOV64ri 0, debug-location !7
309 DBG_INSTR_REF !8, !DIExpression(DW_OP_LLVM_arg, 0, DW_OP_constu, 1, DW_OP_plus, DW_OP_stack_value), dbg-instr-ref(16, 0), debug-location !7
310 ; CHECK: DBG_VALUE_LIST ![[VARNUM]],
311 ; CHECK-SAME: !DIExpression(DW_OP_LLVM_arg, 0, DW_OP_constu, 8, DW_OP_minus, DW_OP_deref_size, 8, DW_OP_constu, 1, DW_OP_plus, DW_OP_stack_value), $rsp
312 $eax = MOV32ri 0, debug-location !7
313 DBG_VALUE $noreg, $noreg, !8, !DIExpression(), debug-location !7
314 ; CHECK: DBG_VALUE $noreg, $noreg
316 ;; Scalar (32), Same value size (32), no stack value,
317 $eax = MOV32ri 0, debug-instr-number 17, debug-location !7
318 MOV32mr $rsp, 1, $noreg, -8, $noreg, renamable $eax :: (store 4 into %stack.0)
319 $rax = MOV64ri 0, debug-location !7
320 DBG_INSTR_REF !8, !DIExpression(DW_OP_LLVM_arg, 0, DW_OP_constu, 1, DW_OP_plus, DW_OP_stack_value), dbg-instr-ref(17, 0), debug-location !7
321 ; CHECK: DBG_VALUE_LIST ![[VARNUM]],
322 ; CHECK-SAME: !DIExpression(DW_OP_LLVM_arg, 0, DW_OP_constu, 8, DW_OP_minus, DW_OP_deref, DW_OP_constu, 1, DW_OP_plus, DW_OP_stack_value), $rsp
323 $eax = MOV32ri 0, debug-location !7
324 DBG_VALUE $noreg, $noreg, !8, !DIExpression(), debug-location !7
325 ; CHECK: DBG_VALUE $noreg, $noreg
327 ;; Scalar (32), Smaller value (8), no stack value,
328 $al = MOV8ri 0, debug-instr-number 18, debug-location !7
329 MOV8mr $rsp, 1, $noreg, -8, $noreg, renamable $al :: (store 1 into %stack.0)
330 $rax = MOV64ri 0, debug-location !7
331 DBG_INSTR_REF !8, !DIExpression(DW_OP_LLVM_arg, 0, DW_OP_constu, 1, DW_OP_plus, DW_OP_stack_value), dbg-instr-ref(18, 0), debug-location !7
332 ; CHECK: DBG_VALUE_LIST ![[VARNUM]],
333 ; CHECK-SAME: !DIExpression(DW_OP_LLVM_arg, 0, DW_OP_constu, 8, DW_OP_minus, DW_OP_deref_size, 1, DW_OP_constu, 1, DW_OP_plus, DW_OP_stack_value), $rsp
334 $eax = MOV32ri 0, debug-location !7
335 DBG_VALUE $noreg, $noreg, !8, !DIExpression(), debug-location !7
336 ; CHECK: DBG_VALUE $noreg, $noreg
338 ;; Fragment (32), Larger value (64), no stack value,
339 $rax = MOV64ri 0, debug-instr-number 19, debug-location !7
340 MOV64mr $rsp, 1, $noreg, -8, $noreg, renamable $rax :: (store 8 into %stack.0)
341 $rax = MOV64ri 0, debug-location !7
342 DBG_INSTR_REF !10, !DIExpression(DW_OP_LLVM_arg, 0, DW_OP_constu, 1, DW_OP_plus, DW_OP_stack_value, DW_OP_LLVM_fragment, 0, 32), dbg-instr-ref(19, 0), debug-location !7
343 ; CHECK: DBG_VALUE_LIST ![[VARNUM2]],
344 ; CHECK-SAME: !DIExpression(DW_OP_LLVM_arg, 0, DW_OP_constu, 8, DW_OP_minus, DW_OP_deref_size, 8, DW_OP_constu, 1, DW_OP_plus, DW_OP_stack_value, DW_OP_LLVM_fragment, 0, 32), $rsp
345 $eax = MOV32ri 0, debug-location !7
346 DBG_VALUE $noreg, $noreg, !10, !DIExpression(DW_OP_LLVM_fragment, 0, 32), debug-location !7
347 ; CHECK: DBG_VALUE $noreg, $noreg
349 ;; Fragment (32), Same value size (32), no stack value,
350 $eax = MOV32ri 0, debug-instr-number 20, debug-location !7
351 MOV32mr $rsp, 1, $noreg, -8, $noreg, renamable $eax :: (store 4 into %stack.0)
352 $rax = MOV64ri 0, debug-location !7
353 DBG_INSTR_REF !10, !DIExpression(DW_OP_LLVM_arg, 0, DW_OP_constu, 1, DW_OP_plus, DW_OP_stack_value, DW_OP_LLVM_fragment, 0, 32), dbg-instr-ref(20, 0), debug-location !7
354 ; CHECK: DBG_VALUE_LIST ![[VARNUM2]],
355 ; CHECK-SAME: !DIExpression(DW_OP_LLVM_arg, 0, DW_OP_constu, 8, DW_OP_minus, DW_OP_deref_size, 4, DW_OP_constu, 1, DW_OP_plus, DW_OP_stack_value, DW_OP_LLVM_fragment, 0, 32), $rsp
356 $eax = MOV32ri 0, debug-location !7
357 DBG_VALUE $noreg, $noreg, !10, !DIExpression(DW_OP_LLVM_fragment, 0, 32), debug-location !7
358 ; CHECK: DBG_VALUE $noreg, $noreg
360 ;; Fragment (32), Smaller value (8), no stack value,
361 $al = MOV8ri 0, debug-instr-number 21, debug-location !7
362 MOV8mr $rsp, 1, $noreg, -8, $noreg, renamable $al :: (store 1 into %stack.0)
363 $rax = MOV64ri 0, debug-location !7
364 DBG_INSTR_REF !10, !DIExpression(DW_OP_LLVM_arg, 0, DW_OP_constu, 1, DW_OP_plus, DW_OP_stack_value, DW_OP_LLVM_fragment, 0, 32), dbg-instr-ref(21, 0), debug-location !7
365 ; CHECK: DBG_VALUE_LIST ![[VARNUM2]],
366 ; CHECK-SAME: !DIExpression(DW_OP_LLVM_arg, 0, DW_OP_constu, 8, DW_OP_minus, DW_OP_deref_size, 1, DW_OP_constu, 1, DW_OP_plus, DW_OP_stack_value, DW_OP_LLVM_fragment, 0, 32), $rsp
367 $eax = MOV32ri 0, debug-location !7
368 DBG_VALUE $noreg, $noreg, !10, !DIExpression(DW_OP_LLVM_fragment, 0, 32), debug-location !7
369 ; CHECK: DBG_VALUE $noreg, $noreg
371 RET64 0, debug-location !7