137 lines · plain
1# RUN: llc -emit-call-site-info -mtriple aarch64-linux-gnu -debug-entry-values -start-after=machineverifier -filetype=obj %s -o -| llvm-dwarfdump -| FileCheck %s2#3# Based on the following C reproducer:4#5# #include <stdint.h>6#7# extern void call1(int64_t);8# extern void call2(int64_t);9# extern void call3(int64_t);10# extern void call4(int64_t);11#12# void caller() {13# call1(UINT64_C(1) << 0);14# call2(UINT64_C(1) << 16);15# call3(UINT64_C(1) << 32);16# call4(UINT64_C(1) << 48);17# }18#19# CHECK: DW_TAG_GNU_call_site20# CHECK-NEXT: DW_AT_abstract_origin {{.*}} "call1"21# CHECK: DW_TAG_GNU_call_site_parameter22# CHECK-NEXT: DW_AT_location (DW_OP_reg0 W0)23# CHECK-NEXT: DW_AT_GNU_call_site_value (DW_OP_lit1)24# CHECK-EMPTY:25# CHECK: DW_TAG_GNU_call_site26# CHECK-NEXT: DW_AT_abstract_origin {{.*}} "call2"27# CHECK: DW_TAG_GNU_call_site_parameter28# CHECK-NEXT: DW_AT_location (DW_OP_reg0 W0)29# CHECK-NEXT: DW_AT_GNU_call_site_value (DW_OP_constu 0x10000)30# CHECK-EMPTY:31# CHECK: DW_TAG_GNU_call_site32# CHECK-NEXT: DW_AT_abstract_origin {{.*}} "call3"33# CHECK: DW_TAG_GNU_call_site_parameter34# CHECK-NEXT: DW_AT_location (DW_OP_reg0 W0)35# CHECK-NEXT: DW_AT_GNU_call_site_value (DW_OP_constu 0x100000000)36# CHECK-EMPTY:37# CHECK: DW_TAG_GNU_call_site38# CHECK-NEXT: DW_AT_abstract_origin {{.*}} "call4"39# CHECK: DW_TAG_GNU_call_site_parameter40# CHECK-NEXT: DW_AT_location (DW_OP_reg0 W0)41# CHECK-NEXT: DW_AT_GNU_call_site_value (DW_OP_constu 0x1000000000000)42#43--- |44 ; ModuleID = '1.c'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"48 49 ; Function Attrs: nounwind50 define dso_local void @caller() local_unnamed_addr #0 !dbg !15 {51 entry:52 tail call void @call1(i64 1), !dbg !1853 tail call void @call2(i64 65536), !dbg !1954 tail call void @call3(i64 4294967296), !dbg !2055 tail call void @call4(i64 281474976710656), !dbg !2156 ret void, !dbg !2257 }58 59 declare !dbg !4 dso_local void @call1(i64) local_unnamed_addr60 61 declare !dbg !8 dso_local void @call2(i64) local_unnamed_addr62 63 declare !dbg !9 dso_local void @call3(i64) local_unnamed_addr64 65 declare !dbg !10 dso_local void @call4(i64) local_unnamed_addr66 67 attributes #0 = { nounwind "frame-pointer"="all" }68 69 !llvm.dbg.cu = !{!0}70 !llvm.module.flags = !{!11, !12, !13}71 !llvm.ident = !{!14}72 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")75 !2 = !{}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)79 !6 = !{null, !7}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)90 !17 = !{null}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)96 97...98---99name: caller100alignment: 4101stack: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: '' }108callSites: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' } }117body: |118 bb.0.entry:119 liveins: $lr120 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, 0123 frame-setup CFI_INSTRUCTION def_cfa $w29, 16124 frame-setup CFI_INSTRUCTION offset $w30, -8, debug-location !18125 frame-setup CFI_INSTRUCTION offset $w29, -16, debug-location !18126 dead $w0 = MOVZWi 1, 0, implicit-def $x0, debug-location !18127 BL @call1, csr_aarch64_aapcs, implicit-def dead $lr, implicit $sp, implicit killed $x0, implicit-def $sp, debug-location !18128 dead $w0 = MOVZWi 1, 16, implicit-def $x0, debug-location !19129 BL @call2, csr_aarch64_aapcs, implicit-def dead $lr, implicit $sp, implicit killed $x0, implicit-def $sp, debug-location !19130 $x0 = MOVZXi 1, 32, debug-location !20131 BL @call3, csr_aarch64_aapcs, implicit-def dead $lr, implicit $sp, implicit killed $x0, implicit-def $sp, debug-location !20132 $x0 = MOVZXi 1, 48, debug-location !21133 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 !21135 136...137