1 # RUN: llc -emit-call-site-info -mtriple aarch64-linux-gnu -debug-entry-values -start-after=machineverifier -filetype=obj %s -o -| llvm-dwarfdump -| FileCheck %s
3 # Based on the following C reproducer:
7 # extern void call1(int64_t);
8 # extern void call2(int64_t);
9 # extern void call3(int64_t);
10 # extern void call4(int64_t);
13 # call1(UINT64_C(1) << 0);
14 # call2(UINT64_C(1) << 16);
15 # call3(UINT64_C(1) << 32);
16 # call4(UINT64_C(1) << 48);
19 # CHECK: DW_TAG_GNU_call_site
20 # CHECK-NEXT: DW_AT_abstract_origin {{.*}} "call1"
21 # CHECK: DW_TAG_GNU_call_site_parameter
22 # CHECK-NEXT: DW_AT_location (DW_OP_reg0 W0)
23 # CHECK-NEXT: DW_AT_GNU_call_site_value (DW_OP_lit1)
25 # CHECK: DW_TAG_GNU_call_site
26 # CHECK-NEXT: DW_AT_abstract_origin {{.*}} "call2"
27 # CHECK: DW_TAG_GNU_call_site_parameter
28 # CHECK-NEXT: DW_AT_location (DW_OP_reg0 W0)
29 # CHECK-NEXT: DW_AT_GNU_call_site_value (DW_OP_constu 0x10000)
31 # CHECK: DW_TAG_GNU_call_site
32 # CHECK-NEXT: DW_AT_abstract_origin {{.*}} "call3"
33 # CHECK: DW_TAG_GNU_call_site_parameter
34 # CHECK-NEXT: DW_AT_location (DW_OP_reg0 W0)
35 # CHECK-NEXT: DW_AT_GNU_call_site_value (DW_OP_constu 0x100000000)
37 # CHECK: DW_TAG_GNU_call_site
38 # CHECK-NEXT: DW_AT_abstract_origin {{.*}} "call4"
39 # CHECK: DW_TAG_GNU_call_site_parameter
40 # CHECK-NEXT: DW_AT_location (DW_OP_reg0 W0)
41 # CHECK-NEXT: DW_AT_GNU_call_site_value (DW_OP_constu 0x1000000000000)
45 source_filename = "1.c"
46 target datalayout = "e-m:e-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128"
47 target triple = "aarch64"
49 ; Function Attrs: nounwind
50 define dso_local void @caller() local_unnamed_addr #0 !dbg !15 {
52 tail call void @call1(i64 1), !dbg !18
53 tail call void @call2(i64 65536), !dbg !19
54 tail call void @call3(i64 4294967296), !dbg !20
55 tail call void @call4(i64 281474976710656), !dbg !21
59 declare !dbg !4 dso_local void @call1(i64) local_unnamed_addr
61 declare !dbg !8 dso_local void @call2(i64) local_unnamed_addr
63 declare !dbg !9 dso_local void @call3(i64) local_unnamed_addr
65 declare !dbg !10 dso_local void @call4(i64) local_unnamed_addr
67 attributes #0 = { nounwind "frame-pointer"="all" }
70 !llvm.module.flags = !{!11, !12, !13}
73 !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)
74 !1 = !DIFile(filename: "1.c", directory: "/dir")
76 !3 = !{!4, !8, !9, !10}
77 !4 = !DISubprogram(name: "call1", scope: !1, file: !1, line: 3, type: !5, flags: DIFlagPrototyped, spFlags: DISPFlagOptimized, retainedNodes: !2)
78 !5 = !DISubroutineType(types: !6)
80 !7 = !DIBasicType(name: "long long int", size: 64, encoding: DW_ATE_signed)
81 !8 = !DISubprogram(name: "call2", scope: !1, file: !1, line: 4, type: !5, flags: DIFlagPrototyped, spFlags: DISPFlagOptimized, retainedNodes: !2)
82 !9 = !DISubprogram(name: "call3", scope: !1, file: !1, line: 5, type: !5, flags: DIFlagPrototyped, spFlags: DISPFlagOptimized, retainedNodes: !2)
83 !10 = !DISubprogram(name: "call4", scope: !1, file: !1, line: 6, type: !5, flags: DIFlagPrototyped, spFlags: DISPFlagOptimized, retainedNodes: !2)
84 !11 = !{i32 2, !"Dwarf Version", i32 4}
85 !12 = !{i32 2, !"Debug Info Version", i32 3}
86 !13 = !{i32 1, !"wchar_size", i32 4}
87 !14 = !{!"clang version 10.0.0"}
88 !15 = distinct !DISubprogram(name: "caller", scope: !1, file: !1, line: 8, type: !16, scopeLine: 8, flags: DIFlagAllCallsDescribed, spFlags: DISPFlagDefinition | DISPFlagOptimized, unit: !0, retainedNodes: !2)
89 !16 = !DISubroutineType(types: !17)
91 !18 = !DILocation(line: 9, column: 7, scope: !15)
92 !19 = !DILocation(line: 10, column: 7, scope: !15)
93 !20 = !DILocation(line: 11, column: 7, scope: !15)
94 !21 = !DILocation(line: 12, column: 7, scope: !15)
95 !22 = !DILocation(line: 13, column: 4, scope: !15)
102 - { id: 0, name: '', type: spill-slot, offset: -8, size: 8, alignment: 8,
103 stack-id: default, callee-saved-register: '$lr', callee-saved-restored: true,
104 debug-info-variable: '', debug-info-expression: '', debug-info-location: '' }
105 - { id: 1, name: '', type: spill-slot, offset: -16, size: 8, alignment: 8,
106 stack-id: default, callee-saved-register: '$fp', callee-saved-restored: true,
107 debug-info-variable: '', debug-info-expression: '', debug-info-location: '' }
109 - { bb: 0, offset: 6, fwdArgRegs:
110 - { arg: 0, reg: '$x0' } }
111 - { bb: 0, offset: 8, fwdArgRegs:
112 - { arg: 0, reg: '$x0' } }
113 - { bb: 0, offset: 10, fwdArgRegs:
114 - { arg: 0, reg: '$x0' } }
115 - { bb: 0, offset: 13, fwdArgRegs:
116 - { arg: 0, reg: '$x0' } }
121 early-clobber $sp = frame-setup STPXpre $fp, killed $lr, $sp, -2 :: (store (s64) into %stack.1), (store (s64) into %stack.0)
122 $fp = frame-setup ADDXri $sp, 0, 0
123 frame-setup CFI_INSTRUCTION def_cfa $w29, 16
124 frame-setup CFI_INSTRUCTION offset $w30, -8, debug-location !18
125 frame-setup CFI_INSTRUCTION offset $w29, -16, debug-location !18
126 dead $w0 = MOVZWi 1, 0, implicit-def $x0, debug-location !18
127 BL @call1, csr_aarch64_aapcs, implicit-def dead $lr, implicit $sp, implicit killed $x0, implicit-def $sp, debug-location !18
128 dead $w0 = MOVZWi 1, 16, implicit-def $x0, debug-location !19
129 BL @call2, csr_aarch64_aapcs, implicit-def dead $lr, implicit $sp, implicit killed $x0, implicit-def $sp, debug-location !19
130 $x0 = MOVZXi 1, 32, debug-location !20
131 BL @call3, csr_aarch64_aapcs, implicit-def dead $lr, implicit $sp, implicit killed $x0, implicit-def $sp, debug-location !20
132 $x0 = MOVZXi 1, 48, debug-location !21
133 early-clobber $sp, $fp, $lr = frame-destroy LDPXpost $sp, 2, debug-location !21 :: (load (s64) from %stack.1), (load (s64) from %stack.0)
134 TCRETURNdi @call4, 0, csr_aarch64_aapcs, implicit $sp, implicit killed $x0, debug-location !21