1 # RUN: llc -mtriple=x86_64-- -run-pass livedebugvalues -o - %s | FileCheck %s --implicit-check-not=DBG_VALUE_LIST
\r
3 # A DBG_VALUE_LIST that has a component spilt and restored should had its
\r
4 # expression and operands updated to refer to the stack for that period, and
\r
5 # then return to normal once the value is restored.
\r
7 # CHECK: ![[VAR:[0-9]+]] = !DILocalVariable(name: "c"
\r
9 # CHECK-LABEL: bb.0.entry:
\r
10 # CHECK: DBG_VALUE_LIST ![[VAR]],
\r
11 # CHECK-SAME: !DIExpression(DW_OP_LLVM_arg, 0, DW_OP_LLVM_arg, 1, DW_OP_plus),
\r
12 # CHECK-SAME: $rdi, $rsi,
\r
13 # CHECK: MOV64mr $rsp, 1, $noreg, -16, $noreg, $rdi
\r
14 # CHECK-NEXT: DBG_VALUE_LIST ![[VAR]],
\r
15 # CHECK-SAME: !DIExpression(DW_OP_LLVM_arg, 0, DW_OP_constu, 8, DW_OP_minus, DW_OP_deref, DW_OP_LLVM_arg, 1, DW_OP_plus),
\r
16 # CHECK-SAME: $rsp, $rsi,
\r
17 # CHECK: $rdi = MOV64rm $rsp, 1, $noreg, -16,
\r
18 # CHECK-NEXT: DBG_VALUE_LIST ![[VAR]],
\r
19 # CHECK-SAME: !DIExpression(DW_OP_LLVM_arg, 0, DW_OP_LLVM_arg, 1, DW_OP_plus),
\r
20 # CHECK-SAME: $rdi, $rsi,
\r
23 ; ModuleID = 'test.cpp'
\r
24 source_filename = "test.cpp"
\r
25 target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
\r
26 target triple = "x86_64-unknown-linux-gnu"
\r
28 ; Function Attrs: norecurse nounwind readnone uwtable
\r
29 define dso_local i32 @_Z3fooii(i32 %a, i32 %b) local_unnamed_addr !dbg !7 {
\r
34 ; Function Attrs: nounwind readnone speculatable willreturn
\r
35 declare void @llvm.dbg.value(metadata, metadata, metadata)
\r
37 !llvm.dbg.cu = !{!0}
\r
38 !llvm.module.flags = !{!3, !4, !5}
\r
41 !0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus_14, file: !1, producer: "clang version 11.0.0", isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug, enums: !2, splitDebugInlining: false, nameTableKind: None)
\r
42 !1 = !DIFile(filename: "test.cpp", directory: "/")
\r
44 !3 = !{i32 7, !"Dwarf Version", i32 4}
\r
45 !4 = !{i32 2, !"Debug Info Version", i32 3}
\r
46 !5 = !{i32 1, !"wchar_size", i32 4}
\r
47 !6 = !{!"clang version 11.0.0"}
\r
48 !7 = distinct !DISubprogram(name: "foo", linkageName: "_Z3fooii", scope: !1, file: !1, line: 2, type: !8, scopeLine: 2, flags: DIFlagPrototyped | DIFlagAllCallsDescribed, spFlags: DISPFlagDefinition | DISPFlagOptimized, unit: !0, retainedNodes: !11)
\r
49 !8 = !DISubroutineType(types: !9)
\r
50 !9 = !{!10, !10, !10}
\r
51 !10 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed)
\r
52 !11 = !{!12, !13, !14}
\r
53 !12 = !DILocalVariable(name: "a", arg: 1, scope: !7, file: !1, line: 2, type: !10)
\r
54 !13 = !DILocalVariable(name: "b", arg: 2, scope: !7, file: !1, line: 2, type: !10)
\r
55 !14 = !DILocalVariable(name: "c", scope: !7, file: !1, line: 3, type: !10)
\r
56 !15 = !DILocation(line: 0, scope: !7)
\r
57 !16 = !DILocation(line: 4, column: 12, scope: !7)
\r
58 !17 = !DILocation(line: 4, column: 3, scope: !7)
\r
64 - { id: 0, offset: -16, size: 8, alignment: 8, type: spill-slot }
\r
69 $rsp = frame-setup SUB64ri8 $rsp, 24, implicit-def dead $eflags
\r
70 DBG_VALUE_LIST !14, !DIExpression(DW_OP_LLVM_arg, 0, DW_OP_LLVM_arg, 1, DW_OP_plus), $rdi, $rsi, debug-location !15
\r
71 MOV64mr $rsp, 1, _, -16, _, $rdi, debug-location !15 :: (store (s64) into %stack.0)
\r
72 $rax = COPY killed $rdi
\r
74 $rdi = MOV64rm $rsp, 1, $noreg, -16, $noreg, debug-location !15 :: (load (s64) from %stack.0)
\r