• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# We do not support the call site info for the target now, so we use the experimental option (-emit-call-site-info -debug-entry-values).
2
3# RUN: llc -emit-call-site-info -debug-entry-values -start-after=livedebugvalues -o - %s | FileCheck %s
4
5# This test would previously trigger an assertion when trying to describe the
6# call site value for callee()'s float parameter.
7#
8# Please note that at the time of creating this test the SystemZ target did not
9# support call site information, so the "callSites" array has been manually
10# added. For now, verify that we don't crash, and that no (invalid) call site
11# parameter entry is emitted, but later on when call site information is added
12# to the target the LZER instruction should be properly described.
13
14# CHECK-NOT: DW_TAG_GNU_call_site_parameter
15
16# Based on the following C reproducer:
17#
18# extern void callee(float);
19# int caller() {
20#   callee(0);
21#   return 0;
22# }
23
24--- |
25  target datalayout = "E-m:e-i1:8:16-i8:8:16-i64:64-f128:64-a:8:16-n32:64"
26  target triple = "systemz"
27
28  ; Function Attrs: nounwind
29  define signext i32 @caller() !dbg !12 {
30  entry:
31    tail call void @callee(float 0.000000e+00), !dbg !16
32    ret i32 0, !dbg !17
33  }
34
35  declare !dbg !4 void @callee(float)
36
37  !llvm.dbg.cu = !{!0}
38  !llvm.module.flags = !{!8, !9, !10}
39  !llvm.ident = !{!11}
40
41  !0 = distinct !DICompileUnit(language: DW_LANG_C99, file: !1, producer: "clang version 10.0.0", isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug, enums: !2, retainedTypes: !3, nameTableKind: None)
42  !1 = !DIFile(filename: "systemz-lzer.c", directory: "/")
43  !2 = !{}
44  !3 = !{!4}
45  !4 = !DISubprogram(name: "callee", scope: !1, file: !1, line: 1, type: !5, flags: DIFlagPrototyped, spFlags: DISPFlagOptimized, retainedNodes: !2)
46  !5 = !DISubroutineType(types: !6)
47  !6 = !{null, !7}
48  !7 = !DIBasicType(name: "float", size: 32, encoding: DW_ATE_float)
49  !8 = !{i32 2, !"Dwarf Version", i32 4}
50  !9 = !{i32 2, !"Debug Info Version", i32 3}
51  !10 = !{i32 1, !"wchar_size", i32 4}
52  !11 = !{!"clang version 10.0.0"}
53  !12 = distinct !DISubprogram(name: "caller", scope: !1, file: !1, line: 2, type: !13, scopeLine: 2, flags: DIFlagAllCallsDescribed, spFlags: DISPFlagDefinition | DISPFlagOptimized, unit: !0, retainedNodes: !2)
54  !13 = !DISubroutineType(types: !14)
55  !14 = !{!15}
56  !15 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed)
57  !16 = !DILocation(line: 3, scope: !12)
58  !17 = !DILocation(line: 4, scope: !12)
59
60...
61---
62name:            caller
63tracksRegLiveness: true
64callSites:
65  - { bb: 0, offset: 9, fwdArgRegs:
66      - { arg: 0, reg: '$f0s' } }
67body:             |
68  bb.0.entry:
69    liveins: $r11d, $r15d, $r14d
70
71    STMG killed $r11d, killed $r15d, $r15d, 88, implicit killed $r14d
72    CFI_INSTRUCTION offset $r11d, -72
73    CFI_INSTRUCTION offset $r14d, -48
74    CFI_INSTRUCTION offset $r15d, -40
75    $r15d = AGHI $r15d, -160, implicit-def dead $cc
76    CFI_INSTRUCTION def_cfa_offset 320
77    $r11d = LGR $r15d
78    CFI_INSTRUCTION def_cfa_register $r11d
79    renamable $f0s = LZER
80    CallBRASL @callee, $f0s, csr_systemz, implicit-def dead $r14d, implicit-def dead $cc, implicit $fpc, debug-location !16
81    $r2d = LGHI 0, debug-location !17
82    $r11d, $r15d = LMG $r11d, 248, implicit-def $r14d, debug-location !17
83    Return implicit killed $r2d, debug-location !17
84
85...
86