blob: 6ad64d9d74bbbf46c9f57a377a8d993248d309a7 [file] [log] [blame]
# Test cutoffs for single-location variable analysis.
# Disable validThroughout if the input size exceeds the specified limit
# RUN: llc %s -o - -start-after=livedebugvalues -mtriple=x86_64-unknown-unknown \
# RUN: --singlevarlocation-input-bb-limit=0 -filetype=obj\
# RUN: | llvm-dwarfdump -v -\
# RUN: | FileCheck %s -check-prefix=LIMITED
# RUN: llc %s -o - -start-after=livedebugvalues -mtriple=x86_64-unknown-unknown \
# RUN: --singlevarlocation-input-bb-limit=20 -filetype=obj | llvm-dwarfdump -v -\
# RUN: | FileCheck %s -check-prefix=UNLIMITED
# LIMITED: DW_AT_location [DW_FORM_sec_offset]
# UNLIMITED: DW_AT_location [DW_FORM_exprloc]
--- |
target datalayout = "e-m:o-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
declare i32 @use(i32)
define i32 @foo(i32 %x) !dbg !6 {
entry:
ret i32 1, !dbg !15
}
declare void @llvm.dbg.value(metadata, metadata, metadata)
!llvm.dbg.cu = !{!0}
!llvm.debugify = !{!3, !4}
!llvm.module.flags = !{!5}
!0 = distinct !DICompileUnit(language: DW_LANG_C, file: !1, producer: "debugify", isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug, enums: !2)
!1 = !DIFile(filename: "/tmp/t.ll", directory: "/")
!2 = !{}
!3 = !{i32 4}
!4 = !{i32 2}
!5 = !{i32 2, !"Debug Info Version", i32 3}
!6 = distinct !DISubprogram(name: "foo", linkageName: "foo", scope: null, file: !1, line: 1, type: !7, scopeLine: 1, spFlags: DISPFlagDefinition | DISPFlagOptimized, unit: !0, retainedNodes: !8)
!7 = !DISubroutineType(types: !2)
!8 = !{!9, !11}
!9 = !DILocalVariable(name: "1", scope: !6, file: !1, line: 1, type: !10)
!10 = !DIBasicType(name: "ty32", size: 32, encoding: DW_ATE_unsigned)
!11 = !DILocalVariable(name: "2", scope: !6, file: !1, line: 3, type: !10)
!12 = !DILocation(line: 1, column: 1, scope: !6)
!13 = !DILocation(line: 2, column: 1, scope: !6)
!14 = !DILocation(line: 3, column: 1, scope: !6)
!15 = !DILocation(line: 4, column: 1, scope: !6)
...
---
name: foo
liveins:
- { reg: '$edi', virtual-reg: '' }
stack:
- { id: 0, name: '', type: spill-slot, offset: -12, size: 4, alignment: 4,
stack-id: default, callee-saved-register: '', callee-saved-restored: true,
debug-info-variable: '', debug-info-expression: '', debug-info-location: '' }
body: |
bb.0.entry:
liveins: $edi
DBG_VALUE renamable $edi, $noreg, !11, !DIExpression(), debug-location !14
RETQ debug-location !14
...