1 # RUN: llc %s -o - -mtriple=x86_64-unknown-unknown \
2 # RUN: -experimental-debug-variable-locations -run-pass=livedebugvalues\
3 # RUN: | FileCheck %s --implicit-check-not=DBG_VALUE \
4 # RUN: --implicit-check-not=DBG_VALUE_LIST
6 # Test that any DBG_VALUE_LISTs observed are interpreted as DBG_VALUE $noreg.
7 # This is obviously sub-optimal, but avoids false variable locations, for the
8 # period of time until InstrRefBasedLDV supports these variable locations.
11 target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
12 target triple = "x86_64-unknown-linux-gnu"
14 define dso_local i32 @foo() !dbg !7 {
20 !llvm.module.flags = !{!3, !4, !5}
23 !0 = distinct !DICompileUnit(language: DW_LANG_C99, file: !1, isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, enums: !2, splitDebugInlining: false, nameTableKind: None)
24 !1 = !DIFile(filename: "test.c", directory: "/tmp/out.c")
26 !3 = !{i32 7, !"Dwarf Version", i32 4}
27 !4 = !{i32 2, !"Debug Info Version", i32 3}
28 !5 = !{i32 1, !"wchar_size", i32 4}
30 !7 = distinct !DISubprogram(name: "foo", scope: !1, file: !1, line: 3, type: !8, scopeLine: 3, flags: DIFlagPrototyped, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !2)
31 !8 = !DISubroutineType(types: !9)
33 !10 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed)
34 !11 = !DIBasicType(name: "long int", size: 64, encoding: DW_ATE_signed)
35 !12 = !DILocalVariable(name: "bar", arg: 1, scope: !7, file: !1, line: 3, type: !11)
36 !13 = !DILocation(line: 0, scope: !7)
37 !14 = !DILocalVariable(name: "baz", arg: 2, scope: !7, file: !1, line: 3, type: !11)
43 tracksRegLiveness: true
44 machineFunctionInfo: {}
47 liveins: $rdi, $rsi, $r14, $rbx
50 $rax = MOV64ri 0, debug-location !13
51 $rbx = MOV64ri 0, debug-location !13
52 DBG_VALUE_LIST !12, !DIExpression(), $rax, $rbx, debug-location !13
53 ; CHECK: DBG_VALUE_LIST
59 ; Earlier DBG_VALUE_LIST should not be propagated here, would be caught
60 ; by implicit check not on FileCheck cmdline.
62 DBG_VALUE $rax, $noreg, !12, !DIExpression(), debug-location !13
64 $rbx = MOV64ri 0, debug-location !13
65 DBG_VALUE_LIST !12, !DIExpression(), $rax, $rbx, debug-location !13
66 ; CHECK: DBG_VALUE_LIST
67 $rbx = COPY killed $rax, debug-location !13
68 $rax = MOV64ri 0, debug-location !13
69 ; This clobber of $rax might cause LDV to re-issue a DBG_VALUE stating the
70 ; variable location as $rbx. However, the preceeding DBG_VALUE_LIST should
71 ; terminate the earlier location.
72 RETQ implicit $rbx, debug-location !13