brintos

brintos / llvm-project-archived public Read only

0
0
Text · 2.7 KiB · 041ffac Raw
73 lines · plain
1# RUN: llc %s -run-pass=livedebugvalues -experimental-debug-variable-locations\2# RUN:   -o - | FileCheck %s3#4# In the MIR below, there's an argument in the lowest byte of $edi. The debug5# intrinsics correctly identify the value and where it becomes the variables6# value, however a bug in InstrRefBasedLDV meant that not all subregisters of7# DBG_PHI operands are tracked. That leads to the wrong DBG_VALUE location8# being produced, and a crash under asan.9#10# CHECK-LABEL: name: foo11# CHECK:       DBG_PHI $edi12# CHECK-NEXT:  DBG_INSTR_REF {{.+}}, dbg-instr-ref(2, 0)13# CHECK-NEXT:  DBG_VALUE_LIST {{.+}} $dil14--- |15  ; ModuleID = 'out.ll'16  source_filename = "out.ll"17  target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"18  target triple = "x86_64-scei-ps4"19 20  @someglobal = external local_unnamed_addr global i8, align 121 22  define hidden void @foo(i1 zeroext %bar) !dbg !7 {23  entry:24    ret void, !dbg !1325  }26 27  declare void @llvm.dbg.value(metadata, metadata, metadata)28 29  !llvm.dbg.cu = !{!0}30  !llvm.module.flags = !{!3, !4, !5}31  !llvm.ident = !{!6}32 33  !0 = distinct !DICompileUnit(language: DW_LANG_C99, file: !1, isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, enums: !2, splitDebugInlining: false, nameTableKind: None)34  !1 = !DIFile(filename: "test.c", directory: "/tmp/out.c")35  !2 = !{}36  !3 = !{i32 7, !"Dwarf Version", i32 4}37  !4 = !{i32 2, !"Debug Info Version", i32 3}38  !5 = !{i32 1, !"wchar_size", i32 4}39  !6 = !{!""}40  !7 = distinct !DISubprogram(name: "foo", scope: !1, file: !1, line: 3, type: !8, scopeLine: 3, flags: DIFlagPrototyped, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !2)41  !8 = !DISubroutineType(types: !9)42  !9 = !{!10, !11, !11}43  !10 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed)44  !11 = !DIBasicType(name: "long int", size: 64, encoding: DW_ATE_signed)45  !12 = !DILocalVariable(name: "baz", arg: 2, scope: !7, file: !1, line: 3, type: !11)46  !13 = !DILocation(line: 0, scope: !7)47 48...49---50name:            foo51alignment:       1652tracksRegLiveness: true53debugInstrRef: true54liveins:55  - { reg: '$edi' }56frameInfo:57  maxAlignment:    158  maxCallFrameSize: 059debugValueSubstitutions:60  - { srcinst: 2, srcop: 0, dstinst: 1, dstop: 0, subreg: 1 }61machineFunctionInfo: {}62body:             |63  bb.0.entry:64    liveins: $edi65 66    DBG_PHI $edi, 167    DBG_INSTR_REF !12, !DIExpression(DW_OP_LLVM_arg, 0), dbg-instr-ref(2, 0), debug-location !1368    renamable $rax = MOV64rm $rip, 1, $noreg, target-flags(x86-gotpcrel) @someglobal, $noreg, debug-location !13 :: (load (s64) from got)69    MOV8mr killed renamable $rax, 1, $noreg, 0, $noreg, renamable $dil, debug-location !13 :: (store (s8) into @someglobal)70    RET64 debug-location !1371 72...73