llvm-for-llvmta/test/DebugInfo/MIR/AArch64/dbgcall-site-expr-entry-val...

93 lines
4.2 KiB
Plaintext
Raw Permalink Normal View History

2022-04-25 10:02:23 +02:00
# RUN: llc -mtriple aarch64-linux-gnu -emit-call-site-info -debug-entry-values -start-after=livedebugvalues -filetype=obj -o - %s \
# RUN: | llvm-dwarfdump - | FileCheck %s --implicit-check-not=DW_TAG_GNU_call_site_parameter
#
# Based on the following C reproducer:
#
# extern void call(long, long, long);
#
# void entry_value (long param) {
# call(param + 222, param - 444, param);
# }
--- |
target datalayout = "e-m:e-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128"
target triple = "aarch64"
define dso_local void @entry_value(i64 %param) local_unnamed_addr !dbg !12 {
entry:
call void @llvm.dbg.value(metadata i64 %param, metadata !16, metadata !DIExpression()), !dbg !17
%add = add nsw i64 %param, 222, !dbg !17
%sub = add nsw i64 %param, -444, !dbg !17
call void @call(i64 %add, i64 %sub, i64 %param), !dbg !17
ret void, !dbg !17
}
declare !dbg !4 dso_local void @call(i64, i64, i64) local_unnamed_addr
declare void @llvm.dbg.value(metadata, metadata, metadata)
!llvm.dbg.cu = !{!0}
!llvm.module.flags = !{!8, !9, !10}
!llvm.ident = !{!11}
!0 = distinct !DICompileUnit(language: DW_LANG_C99, file: !1, producer: "clang version 11.0.0 ", isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug, enums: !2, retainedTypes: !3, splitDebugInlining: false, nameTableKind: None)
!1 = !DIFile(filename: "dbgcall-site-expr-entry-value.mir", directory: "/")
!2 = !{}
!3 = !{!4}
!4 = !DISubprogram(name: "call", scope: !1, file: !1, line: 1, type: !5, flags: DIFlagPrototyped, spFlags: DISPFlagOptimized, retainedNodes: !2)
!5 = !DISubroutineType(types: !6)
!6 = !{null, !7, !7, !7}
!7 = !DIBasicType(name: "long int", size: 64, encoding: DW_ATE_signed)
!8 = !{i32 7, !"Dwarf Version", i32 4}
!9 = !{i32 2, !"Debug Info Version", i32 3}
!10 = !{i32 1, !"wchar_size", i32 4}
!11 = !{!"clang version 11.0.0 "}
!12 = distinct !DISubprogram(name: "entry_value", scope: !1, file: !1, line: 3, type: !13, scopeLine: 3, flags: DIFlagPrototyped | DIFlagAllCallsDescribed, spFlags: DISPFlagDefinition | DISPFlagOptimized, unit: !0, retainedNodes: !15)
!13 = !DISubroutineType(types: !14)
!14 = !{null, !7}
!15 = !{!16}
!16 = !DILocalVariable(name: "param", arg: 1, scope: !12, file: !1, line: 3, type: !7)
!17 = !DILocation(line: 4, scope: !12)
...
---
name: entry_value
tracksRegLiveness: true
stack:
- { id: 0, type: spill-slot, offset: -8, size: 8, alignment: 8, callee-saved-register: '$lr' }
- { id: 1, type: spill-slot, offset: -16, size: 8, alignment: 8, callee-saved-register: '$fp' }
callSites:
- { bb: 0, offset: 10, fwdArgRegs:
- { arg: 0, reg: '$x0' }
- { arg: 1, reg: '$x1' }
- { arg: 2, reg: '$x2' } }
body: |
bb.0.entry:
liveins: $x0, $lr
DBG_VALUE $x0, $noreg, !16, !DIExpression(), debug-location !17
early-clobber $sp = frame-setup STPXpre $fp, killed $lr, $sp, -2 :: (store 8 into %stack.1), (store 8 into %stack.0)
$fp = frame-setup ADDXri $sp, 0, 0
frame-setup CFI_INSTRUCTION def_cfa $w29, 16
frame-setup CFI_INSTRUCTION offset $w30, -8
frame-setup CFI_INSTRUCTION offset $w29, -16
$x2 = ORRXrs $xzr, $x0, 0
DBG_VALUE $x2, $noreg, !16, !DIExpression(), debug-location !17
renamable $x0 = nsw ADDXri killed $x0, 222, 0, debug-location !17
renamable $x1 = nsw SUBXri renamable $x2, 444, 0, debug-location !17
BL @call, csr_aarch64_aapcs, implicit-def dead $lr, implicit $sp, implicit killed $x0, implicit killed $x1, implicit killed $x2, implicit-def $sp, debug-location !17
early-clobber $sp, $fp, $lr = frame-destroy LDPXpost $sp, 2, debug-location !17 :: (load 8 from %stack.1), (load 8 from %stack.0)
RET undef $lr, debug-location !17
...
# Verify that a call site parameter is emitted for the third parameter. There
# should also be entries for the first and second parameter, but
# DW_OP_LLVM_entry_value operations can currently not be emitted together with
# any other expressions. Verify that nothing is emitted rather than an assert
# being triggered, or broken expressions being emitted.
# CHECK: DW_TAG_GNU_call_site_parameter
# CHECK-NEXT: DW_AT_location (DW_OP_reg2 W2)
# CHECK-NEXT: DW_AT_GNU_call_site_value (DW_OP_GNU_entry_value(DW_OP_reg0 W0))