1 # RUN: llc -start-before=livedebugvalues -mtriple=x86_64-apple-darwin -o %t %s -filetype=obj
2 # RUN: llvm-dwarfdump %t | FileCheck %s
4 # RUN: llc -force-instr-ref-livedebugvalues=1 -start-before=livedebugvalues -mtriple=x86_64-apple-darwin -o %t %s -filetype=obj
5 # RUN: llvm-dwarfdump %t | FileCheck %s
7 # RUN: llc -start-before=livedebugvalues -debugger-tune=sce -mtriple=x86_64-sce-ps4 -o %t1 %s -filetype=obj
8 # RUN: llvm-dwarfdump %t1 | FileCheck %s -check-prefix=SCE
10 # RUN: llc -force-instr-ref-livedebugvalues=1 -start-before=livedebugvalues -debugger-tune=sce -mtriple=x86_64-sce-ps4 -o %t1 %s -filetype=obj
11 # RUN: llvm-dwarfdump %t1 | FileCheck %s -check-prefix=SCE
15 ## int foo(int p, int q, int r) {
17 ## asm __volatile("" : : : "edi", "esi", "edx");
21 # CHECK: DW_TAG_formal_parameter
22 # CHECK: DW_OP_entry_value
24 # SCE-NOT: DW_OP_{{.*}}entry_value
27 ; ModuleID = 'multiple-param-dbg-value-entry.ll'
28 source_filename = "multiple-param-dbg-value-entry.c"
29 target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
31 @global = common dso_local local_unnamed_addr global i32 0, align 4, !dbg !0
33 define dso_local i32 @foo(i32 %p, i32 %q, i32 %r) local_unnamed_addr !dbg !11 {
35 call void @llvm.dbg.value(metadata i32 %p, metadata !15, metadata !DIExpression()), !dbg !18
36 call void @llvm.dbg.value(metadata i32 %q, metadata !16, metadata !DIExpression()), !dbg !18
37 call void @llvm.dbg.value(metadata i32 %r, metadata !17, metadata !DIExpression()), !dbg !18
38 %add = add nsw i32 %p, 1, !dbg !18
39 store i32 %add, i32* @global, align 4, !dbg !18
40 tail call void asm sideeffect "", "~{edi},~{esi},~{edx},~{dirflag},~{fpsr},~{flags}"(), !dbg !18, !srcloc !19
44 ; Function Attrs: nounwind readnone speculatable
45 declare void @llvm.dbg.value(metadata, metadata, metadata)
48 !llvm.module.flags = !{!7, !8, !9}
51 !0 = !DIGlobalVariableExpression(var: !1, expr: !DIExpression())
52 !1 = distinct !DIGlobalVariable(name: "global", scope: !2, file: !3, line: 8, type: !6, isLocal: false, isDefinition: true)
53 !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)
54 !3 = !DIFile(filename: "multiple-param-dbg-value-entry.c", directory: "/")
57 !6 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed)
58 !7 = !{i32 2, !"Dwarf Version", i32 4}
59 !8 = !{i32 2, !"Debug Info Version", i32 3}
60 !9 = !{i32 1, !"wchar_size", i32 4}
61 !10 = !{!"clang version 9.0.0 "}
62 !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)
63 !12 = !DISubroutineType(types: !13)
64 !13 = !{!6, !6, !6, !6}
65 !14 = !{!15, !16, !17}
66 !15 = !DILocalVariable(name: "p", arg: 1, scope: !11, file: !3, line: 9, type: !6)
67 !16 = !DILocalVariable(name: "q", arg: 2, scope: !11, file: !3, line: 9, type: !6)
68 !17 = !DILocalVariable(name: "r", arg: 3, scope: !11, file: !3, line: 9, type: !6)
69 !18 = !DILocation(line: 9, column: 13, scope: !11)
76 tracksRegLiveness: true
83 DBG_VALUE $edi, $noreg, !15, !DIExpression(), debug-location !18
84 DBG_VALUE $edi, $noreg, !15, !DIExpression(), debug-location !18
85 DBG_VALUE $esi, $noreg, !16, !DIExpression(), debug-location !18
86 DBG_VALUE $edx, $noreg, !17, !DIExpression(), debug-location !18
87 renamable $edi = nsw INC32r killed renamable $edi, implicit-def dead $eflags, debug-location !18
88 MOV32mr $rip, 1, $noreg, @global, $noreg, killed renamable $edi, debug-location !18 :: (store (s32) into @global)
89 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
90 $eax = MOV32ri 123, debug-location !18
91 RETQ killed $eax, debug-location !18