1 # RUN: llc -debug-entry-values -start-before=livedebugvalues -mtriple=x86_64-apple-darwin -o %t %s -filetype=obj
2 # RUN: llvm-dwarfdump %t | FileCheck %s
5 # int foo(int p, int q, int r) {
7 # asm __volatile("" : : : "edi", "esi", "edx");
11 # CHECK: DW_TAG_formal_parameter
12 # CHECK: DW_OP_entry_value
15 ; ModuleID = 'multiple-param-dbg-value-entry.ll'
16 source_filename = "multiple-param-dbg-value-entry.c"
17 target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
19 @global = common dso_local local_unnamed_addr global i32 0, align 4, !dbg !0
21 define dso_local i32 @foo(i32 %p, i32 %q, i32 %r) local_unnamed_addr !dbg !11 {
23 call void @llvm.dbg.value(metadata i32 %p, metadata !15, metadata !DIExpression()), !dbg !18
24 call void @llvm.dbg.value(metadata i32 %q, metadata !16, metadata !DIExpression()), !dbg !18
25 call void @llvm.dbg.value(metadata i32 %r, metadata !17, metadata !DIExpression()), !dbg !18
26 %add = add nsw i32 %p, 1, !dbg !18
27 store i32 %add, i32* @global, align 4, !dbg !18
28 tail call void asm sideeffect "", "~{edi},~{esi},~{edx},~{dirflag},~{fpsr},~{flags}"(), !dbg !18, !srcloc !19
32 ; Function Attrs: nounwind readnone speculatable
33 declare void @llvm.dbg.value(metadata, metadata, metadata)
36 !llvm.module.flags = !{!7, !8, !9}
39 !0 = !DIGlobalVariableExpression(var: !1, expr: !DIExpression())
40 !1 = distinct !DIGlobalVariable(name: "global", scope: !2, file: !3, line: 8, type: !6, isLocal: false, isDefinition: true)
41 !2 = distinct !DICompileUnit(language: DW_LANG_C99, file: !3, producer: "clang version 9.0.0 ", isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug, enums: !4, globals: !5, nameTableKind: None)
42 !3 = !DIFile(filename: "multiple-param-dbg-value-entry.c", directory: "/")
45 !6 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed)
46 !7 = !{i32 2, !"Dwarf Version", i32 4}
47 !8 = !{i32 2, !"Debug Info Version", i32 3}
48 !9 = !{i32 1, !"wchar_size", i32 4}
49 !10 = !{!"clang version 9.0.0 "}
50 !11 = distinct !DISubprogram(name: "foo", scope: !3, file: !3, line: 9, type: !12, scopeLine: 9, flags: DIFlagPrototyped | DIFlagAllCallsDescribed, spFlags: DISPFlagDefinition | DISPFlagOptimized, unit: !2, retainedNodes: !14)
51 !12 = !DISubroutineType(types: !13)
52 !13 = !{!6, !6, !6, !6}
53 !14 = !{!15, !16, !17}
54 !15 = !DILocalVariable(name: "p", arg: 1, scope: !11, file: !3, line: 9, type: !6, flags: DIFlagArgumentNotModified)
55 !16 = !DILocalVariable(name: "q", arg: 2, scope: !11, file: !3, line: 9, type: !6, flags: DIFlagArgumentNotModified)
56 !17 = !DILocalVariable(name: "r", arg: 3, scope: !11, file: !3, line: 9, type: !6, flags: DIFlagArgumentNotModified)
57 !18 = !DILocation(line: 9, column: 13, scope: !11)
64 tracksRegLiveness: true
71 DBG_VALUE $edi, $noreg, !15, !DIExpression(), debug-location !18
72 DBG_VALUE $edi, $noreg, !15, !DIExpression(), debug-location !18
73 DBG_VALUE $esi, $noreg, !16, !DIExpression(), debug-location !18
74 DBG_VALUE $edx, $noreg, !17, !DIExpression(), debug-location !18
75 renamable $edi = nsw INC32r killed renamable $edi, implicit-def dead $eflags, debug-location !18
76 MOV32mr $rip, 1, $noreg, @global, $noreg, killed renamable $edi, debug-location !18 :: (store 4 into @global)
77 INLINEASM &"", 1, 12, implicit-def dead early-clobber $edi, 12, implicit-def dead early-clobber $esi, 12, implicit-def dead early-clobber $edx, 12, implicit-def dead early-clobber $df, 12, implicit-def dead early-clobber $fpsw, 12, implicit-def dead early-clobber $eflags, !19, debug-location !18
78 $eax = MOV32ri 123, debug-location !18
79 RETQ killed $eax, debug-location !18