1 # RUN: llc -mtriple=x86_64-- -run-pass livedebugvalues -o - %s | FileCheck %s --implicit-check-not=DBG_VALUE_LIST
\r
3 # Test that even after a move, clobbering a register terminates a DBG_VALUE_LIST.
\r
4 # Check the same for DBG_VALUE $noreg.
\r
6 # CHECK: ![[VAR:[0-9]+]] = !DILocalVariable(name: "c"
\r
8 # CHECK-LABEL: bb.0.entry:
\r
9 # CHECK: DBG_VALUE_LIST ![[VAR]], !DIExpression(DW_OP_LLVM_arg, 0,
\r
10 # CHECK-SAME: DW_OP_LLVM_arg, 1, DW_OP_plus), $rdi, $rsi
\r
11 # CHECK: $rbx = COPY killed $rdi
\r
12 # CHECK-NEXT: DBG_VALUE_LIST ![[VAR]], !DIExpression(DW_OP_LLVM_arg, 0,
\r
13 # CHECK-SAME: DW_OP_LLVM_arg, 1, DW_OP_plus), $rbx, $rsi
\r
14 # CHECK-LABEL: bb.1:
\r
15 # CHECK: DBG_VALUE_LIST ![[VAR]], !DIExpression(DW_OP_LLVM_arg, 0,
\r
16 # CHECK-SAME: DW_OP_LLVM_arg, 1, DW_OP_plus), $rbx, $rsi
\r
17 # CHECK: $rsi = MOV64ri 0
\r
18 # CHECK-LABEL: bb.2:
\r
20 # CHECK: $rsi = MOV64ri 0
\r
21 # CHECK-NEXT: DBG_VALUE_LIST ![[VAR]], !DIExpression(DW_OP_LLVM_arg, 0,
\r
22 # CHECK-SAME: DW_OP_LLVM_arg, 1, DW_OP_plus), $rbx, $rsi
\r
23 # CHECK-LABEL: bb.3:
\r
24 # CHECK: DBG_VALUE_LIST ![[VAR]], !DIExpression(DW_OP_LLVM_arg, 0,
\r
25 # CHECK-SAME: DW_OP_LLVM_arg, 1, DW_OP_plus), $rbx, $rsi
\r
26 # live-in to bb.3, then explicitly undef'd, should be no further locations
\r
28 # CHECK-LABEL: bb.4:
\r
30 ; ModuleID = 'test.cpp'
\r
31 source_filename = "test.cpp"
\r
32 target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
\r
33 target triple = "x86_64-unknown-linux-gnu"
\r
35 ; Function Attrs: norecurse nounwind readnone uwtable
\r
36 define dso_local i32 @_Z3fooii(i32 %a, i32 %b) local_unnamed_addr !dbg !7 {
\r
41 ; Function Attrs: nounwind readnone speculatable willreturn
\r
42 declare void @llvm.dbg.value(metadata, metadata, metadata)
\r
44 !llvm.dbg.cu = !{!0}
\r
45 !llvm.module.flags = !{!3, !4, !5}
\r
48 !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
49 !1 = !DIFile(filename: "test.cpp", directory: "/")
\r
51 !3 = !{i32 7, !"Dwarf Version", i32 4}
\r
52 !4 = !{i32 2, !"Debug Info Version", i32 3}
\r
53 !5 = !{i32 1, !"wchar_size", i32 4}
\r
54 !6 = !{!"clang version 11.0.0"}
\r
55 !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
56 !8 = !DISubroutineType(types: !9)
\r
57 !9 = !{!10, !10, !10}
\r
58 !10 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed)
\r
59 !11 = !{!12, !13, !14}
\r
60 !12 = !DILocalVariable(name: "a", arg: 1, scope: !7, file: !1, line: 2, type: !10)
\r
61 !13 = !DILocalVariable(name: "b", arg: 2, scope: !7, file: !1, line: 2, type: !10)
\r
62 !14 = !DILocalVariable(name: "c", scope: !7, file: !1, line: 3, type: !10)
\r
63 !15 = !DILocation(line: 0, scope: !7)
\r
64 !16 = !DILocation(line: 4, column: 12, scope: !7)
\r
65 !17 = !DILocation(line: 4, column: 3, scope: !7)
\r
71 - { id: 0, type: spill-slot, offset: -32, size: 8, alignment: 16, stack-id: default,
\r
72 callee-saved-register: '$rbx', callee-saved-restored: true }
\r
73 - { id: 1, type: spill-slot, offset: -16, size: 8, alignment: 16, stack-id: default,
\r
74 callee-saved-register: '$rbp', callee-saved-restored: true }
\r
79 DBG_VALUE_LIST !14, !DIExpression(DW_OP_LLVM_arg, 0, DW_OP_LLVM_arg, 1, DW_OP_plus), $rdi, $rsi, debug-location !15
\r
80 $rbx = COPY killed $rdi
\r
93 DBG_VALUE_LIST !14, !DIExpression(DW_OP_LLVM_arg, 0, DW_OP_LLVM_arg, 1, DW_OP_plus), $rbx, $rsi, debug-location !15
\r
98 DBG_VALUE $noreg, $noreg, !14, !DIExpression(), debug-location !15
\r
102 liveins: $rbx, $rsi
\r
103 RETQ $rbx, debug-location !17
\r