76 lines · plain
1; RUN: llc -emit-call-site-info -debug-entry-values %s -o - -filetype=obj \2; RUN: | llvm-dwarfdump -statistics - | FileCheck %s3;4; The LLVM IR file was generated on this source code by using5; option '-femit-debug-entry-values'.6;7; extern void foo(int *a, int b, int c, int d, int e, int f);8; extern int getVal();9;10; void baa(int arg1, int arg2, int arg3) {11; int local1 = getVal();12; foo(&local1, arg2, 10, 15, arg3 + 3, arg1 + arg2);13; }14;15; CHECK: "#call site DIEs": 2,16; CHECK-NEXT: "#call site parameter DIEs": 6,17;18; ModuleID = 'test.c'19source_filename = "test.c"20target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"21target triple = "x86_64-unknown-linux-gnu"22 23; Function Attrs: nounwind uwtable24define dso_local void @baa(i32 %arg1, i32 %arg2, i32 %arg3) local_unnamed_addr #0 !dbg !10 {25entry:26 %local1 = alloca i32, align 427 call void @llvm.dbg.value(metadata i32 %arg1, metadata !15, metadata !DIExpression()), !dbg !1928 call void @llvm.dbg.value(metadata i32 %arg2, metadata !16, metadata !DIExpression()), !dbg !2029 call void @llvm.dbg.value(metadata i32 %arg3, metadata !17, metadata !DIExpression()), !dbg !2130 %call = tail call i32 (...) @getVal(), !dbg !2331 call void @llvm.dbg.value(metadata i32 %call, metadata !18, metadata !DIExpression()), !dbg !2432 store i32 %call, ptr %local1, align 4, !dbg !2433 %add = add nsw i32 %arg3, 3, !dbg !2434 %add1 = add nsw i32 %arg2, %arg1, !dbg !2435 call void @llvm.dbg.value(metadata ptr %local1, metadata !18, metadata !DIExpression(DW_OP_deref)), !dbg !2436 call void @foo(ptr nonnull %local1, i32 %arg2, i32 10, i32 15, i32 %add, i32 %add1), !dbg !2437 ret void, !dbg !2438}39 40declare !dbg !4 dso_local i32 @getVal(...) local_unnamed_addr41 42declare !dbg !5 dso_local void @foo(ptr, i32, i32, i32, i32, i32) local_unnamed_addr43 44; Function Attrs: nounwind readnone speculatable45declare void @llvm.dbg.value(metadata, metadata, metadata)46 47!llvm.dbg.cu = !{!0}48!llvm.module.flags = !{!6, !7, !8}49!llvm.ident = !{!9}50 51!0 = distinct !DICompileUnit(language: DW_LANG_C99, file: !1, producer: "clang version 9.0.0", isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug, enums: !2, retainedTypes: !3, nameTableKind: None)52!1 = !DIFile(filename: "test.c", directory: "/dir")53!2 = !{}54!3 = !{!4, !5}55!4 = !DISubprogram(name: "getVal", scope: !1, file: !1, line: 2, spFlags: DISPFlagOptimized, retainedNodes: !2)56!5 = !DISubprogram(name: "foo", scope: !1, file: !1, line: 1, flags: DIFlagPrototyped, spFlags: DISPFlagOptimized, retainedNodes: !2)57!6 = !{i32 2, !"Dwarf Version", i32 4}58!7 = !{i32 2, !"Debug Info Version", i32 3}59!8 = !{i32 1, !"wchar_size", i32 4}60!9 = !{!"clang version 9.0.0"}61!10 = distinct !DISubprogram(name: "baa", scope: !1, file: !1, line: 4, type: !11, scopeLine: 4, flags: DIFlagPrototyped | DIFlagAllCallsDescribed, spFlags: DISPFlagDefinition | DISPFlagOptimized, unit: !0, retainedNodes: !14)62!11 = !DISubroutineType(types: !12)63!12 = !{null, !13, !13, !13}64!13 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed)65!14 = !{!15, !16, !17, !18}66!15 = !DILocalVariable(name: "arg1", arg: 1, scope: !10, file: !1, line: 4, type: !13)67!16 = !DILocalVariable(name: "arg2", arg: 2, scope: !10, file: !1, line: 4, type: !13)68!17 = !DILocalVariable(name: "arg3", arg: 3, scope: !10, file: !1, line: 4, type: !13)69!18 = !DILocalVariable(name: "local1", scope: !10, file: !1, line: 5, type: !13)70!19 = !DILocation(line: 4, column: 14, scope: !10)71!20 = !DILocation(line: 4, column: 24, scope: !10)72!21 = !DILocation(line: 4, column: 34, scope: !10)73!22 = !DILocation(line: 5, column: 3, scope: !10)74!23 = !DILocation(line: 5, column: 16, scope: !10)75!24 = !DILocation(line: 5, column: 7, scope: !10)76