53 lines · plain
1# RUN: llc --run-pass=livedebugvalues -o - %s | FileCheck %s2# REQUIRES: x86-registered-target3 4# This test covers the scenario that saves a register on the stack, uses this register as an entry value DBG_VALUE location, and then clobbers it.5 6--- |7 target triple = "x86_64-"8 define void @foo(ptr swiftasync %0) !dbg !4 {9 call void @llvm.dbg.value(metadata ptr %0, metadata !9, metadata !DIExpression(DW_OP_LLVM_entry_value, 1)), !dbg !1710 ret void11 }12 declare void @llvm.dbg.value(metadata, metadata, metadata)13 14 !llvm.module.flags = !{!0}15 !llvm.dbg.cu = !{!1}16 17 !0 = !{i32 2, !"Debug Info Version", i32 3}18 !1 = distinct !DICompileUnit(language: DW_LANG_Swift, file: !2, producer: "blah", isOptimized: true, flags: "blah", runtimeVersion: 5, emissionKind: FullDebug)19 !2 = !DIFile(filename: "blah", directory: "blah")20 !3 = !{}21 !4 = distinct !DISubprogram(name: "blah", linkageName: "blah", scope: !2, file: !2, line: 284, type: !7, unit: !1)22 !7 = !DISubroutineType(types: !3)23 !9 = !DILocalVariable(name: "self", arg: 3, scope: !4, file: !2, line: 328, type: !12, flags: DIFlagArtificial)24 !12 = !DICompositeType(tag: DW_TAG_structure_type, name: "blah", scope: !2, file: !2, size: 64, elements: !3)25 !17 = !DILocation(line: 328, column: 17, scope: !4)26 27...28---29name: foo30alignment: 1631debugInstrRef: true32tracksDebugUserValues: true33liveins:34 - { reg: '$r14', virtual-reg: '' }35stack:36 - { id: 0, name: '', type: spill-slot, offset: -64, size: 8, alignment: 8,37 stack-id: default, callee-saved-register: '', callee-saved-restored: true,38 debug-info-variable: '', debug-info-expression: '', debug-info-location: '' }39body: |40 bb.0:41 liveins: $r1442 ; Put a copy of r14 on the stack.43 MOV64mr $rbp, 1, $noreg, -48, $noreg, $r14 :: (store (s64) into %stack.0)44 DBG_VALUE $r14, $noreg, !9, !DIExpression(DW_OP_LLVM_entry_value, 1), debug-location !1745 MOV64mi32 $noreg, 1, $noreg, 0, $noreg, 0, debug-location !17 :: (store (s64) into `ptr null`)46 $r14 = MOV64rr killed $r1347 ; Clobber $r1448 RETI64 2449# CHECK: bb.0:50# CHECK: MOV64mr $rbp, 1, $noreg, -48, $noreg, $r1451# CHECK-NEXT: DBG_VALUE $r14, {{.*}}, !DIExpression(DW_OP_LLVM_entry_value, 1)52# CHECK-NOT: DBG_VALUE53