1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-25 20:23:11 +01:00
llvm-mirror/test/DebugInfo/MIR/X86/livedebugvalues_loop_within_loop.mir
Jeremy Morse e4b7119dbf [LiveDebugValues][NFC] Re-land 60db26a66d, add instr-ref tests
This was landed but reverted in 5b9c2b1bea7 due to asan picking up a memory
leak. This is fixed in the change to InstrRefBasedImpl.cpp. Original
commit message follows:

[LiveDebugValues][NFC] Add instr-ref tests, adapt old tests

This patch adds a few tests in DebugInfo/MIR/InstrRef/ of interesting
behaviour that the instruction referencing implementation of
LiveDebugValues has. Mostly, these tests exist to ensure that if you
give the "-experimental-debug-variable-locations" command line switch,
the right implementation runs; and to ensure it behaves the same way as
the VarLoc LiveDebugValues implementation.

I've also touched roughly 30 other tests, purely to make the tests less
rigid about what output to accept. DBG_VALUE instructions are usually
printed with a trailing !debug-location indicating its scope:

  !debug-location !1234

However InstrRefBasedLDV produces new DebugLoc instances on the fly,
meaning there sometimes isn't a numbered node when they're printed,
making the output:

  !debug-location !DILocation(line: 0, blah blah)

Which causes a ton of these tests to fail. This patch removes checks for
that final part of each DBG_VALUE instruction. None of them appear to
be actually checking the scope is correct, just that it's present, so
I don't believe there's any loss in coverage here.

Differential Revision: https://reviews.llvm.org/D83054
2020-09-11 12:14:44 +01:00

82 lines
2.9 KiB
YAML

--- |
; RUN: llc %s -march=x86-64 -run-pass=livedebugvalues -o - | FileCheck %s -implicit-check-not=DBG_VALUE
; Check that DBG_VALUE instructions are propagated into loops within loops.
; CHECK-LABEL: bb.0.entry:
; CHECK: DBG_VALUE $ebx, $noreg, !16, !DIExpression()
; CHECK-LABEL: bb.1.bb1:
; CHECK: DBG_VALUE $ebx, $noreg, !16, !DIExpression()
; CHECK-LABEL: bb.2.bb2:
; CHECK: DBG_VALUE $ebx, $noreg, !16, !DIExpression()
; CHECK-LABEL: bb.3.bb3:
; CHECK: DBG_VALUE $ebx, $noreg, !16, !DIExpression()
; CHECK-LABEL: bb.4.bb4:
; CHECK: DBG_VALUE $ebx, $noreg, !16, !DIExpression()
; CHECK-LABEL: bb.5.bb5:
; CHECK: DBG_VALUE $ebx, $noreg, !16, !DIExpression()
define i32 @_Z8bb_to_bb() local_unnamed_addr !dbg !12 {
entry:
br label %bb1, !dbg !17
bb1:
br label %bb2, !dbg !17
bb2:
br label %bb3, !dbg !17
bb3:
br label %bb3, !dbg !17
bb4:
br label %bb3, !dbg !17
bb5:
ret i32 0, !dbg !17
}
!llvm.dbg.cu = !{!0}
!llvm.module.flags = !{!7, !8, !9, !10}
!llvm.ident = !{!11}
!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !1, producer: "clang version 10.0.0", isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug, enums: !2, globals: !3, debugInfoForProfiling: true, nameTableKind: None)
!1 = !DIFile(filename: "main.cpp", directory: "F:\")
!2 = !{}
!3 = !{!4}
!4 = !DIGlobalVariableExpression(var: !5, expr: !DIExpression())
!5 = distinct !DIGlobalVariable(name: "start", scope: !0, file: !1, line: 4, type: !6, isLocal: false, isDefinition: true)
!6 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed)
!7 = !{i32 2, !"Dwarf Version", i32 4}
!8 = !{i32 2, !"Debug Info Version", i32 3}
!9 = !{i32 1, !"wchar_size", i32 2}
!10 = !{i32 7, !"PIC Level", i32 2}
!11 = !{!"clang version 10.0.0"}
!12 = distinct !DISubprogram(name: "bb_to_bb", linkageName: "bb_to_bb", scope: !1, file: !1, line: 6, type: !13, scopeLine: 6, flags: DIFlagPrototyped, spFlags: DISPFlagDefinition | DISPFlagOptimized, unit: !0, retainedNodes: !15)
!13 = !DISubroutineType(types: !14)
!14 = !{!6, !6}
!15 = !{!16}
!16 = !DILocalVariable(name: "myVar", scope: !12, file: !1, line: 7, type: !6)
!17 = !DILocation(line: 10, scope: !12)
...
---
name: _Z8bb_to_bb
body: |
bb.0.entry:
successors: %bb.1
$ebx = MOV32ri 0, debug-location !17
DBG_VALUE $ebx, $noreg, !16, !DIExpression(), debug-location !17
bb.1.bb1:
successors: %bb.2, %bb.4
$eax = MOV32ri 0, debug-location !17
JCC_1 %bb.4, 4, implicit killed $eflags
bb.2.bb2:
successors: %bb.3
$eax = MOV32ri 0, debug-location !17
bb.3.bb3:
successors: %bb.2, %bb.4
$eax = MOV32ri 0, debug-location !17
JCC_1 %bb.2, 4, implicit killed $eflags
bb.4.bb4:
successors: %bb.1, %bb.5
$eax = MOV32ri 0, debug-location !17
JCC_1 %bb.1, 4, implicit killed $eflags
bb.5.bb5:
RETQ $eax, debug-location !17
...