94 lines · plain
1# RUN: llc -start-before=livedebugvalues -mtriple=x86_64-apple-darwin -o %t %s -filetype=obj2# RUN: llvm-dwarfdump %t | FileCheck %s3 4# RUN: llc -force-instr-ref-livedebugvalues=1 -start-before=livedebugvalues -mtriple=x86_64-apple-darwin -o %t %s -filetype=obj5# RUN: llvm-dwarfdump %t | FileCheck %s6 7# RUN: llc -start-before=livedebugvalues -debugger-tune=sce -mtriple=x86_64-sce-ps4 -o %t1 %s -filetype=obj8# RUN: llvm-dwarfdump %t1 | FileCheck %s -check-prefix=SCE9 10# RUN: llc -force-instr-ref-livedebugvalues=1 -start-before=livedebugvalues -debugger-tune=sce -mtriple=x86_64-sce-ps4 -o %t1 %s -filetype=obj11# RUN: llvm-dwarfdump %t1 | FileCheck %s -check-prefix=SCE12 13## Based on:14## int global;15## int foo(int p, int q, int r) {16## global = p + 1;17## asm __volatile("" : : : "edi", "esi", "edx");18## return 123;19## }20 21# CHECK: DW_TAG_formal_parameter22# CHECK: DW_OP_entry_value23 24# SCE-NOT: DW_OP_{{.*}}entry_value25 26--- |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"30 31 @global = common dso_local local_unnamed_addr global i32 0, align 4, !dbg !032 33 define dso_local i32 @foo(i32 %p, i32 %q, i32 %r) local_unnamed_addr !dbg !11 {34 entry:35 call void @llvm.dbg.value(metadata i32 %p, metadata !15, metadata !DIExpression()), !dbg !1836 call void @llvm.dbg.value(metadata i32 %q, metadata !16, metadata !DIExpression()), !dbg !1837 call void @llvm.dbg.value(metadata i32 %r, metadata !17, metadata !DIExpression()), !dbg !1838 %add = add nsw i32 %p, 1, !dbg !1839 store i32 %add, ptr @global, align 4, !dbg !1840 tail call void asm sideeffect "", "~{edi},~{esi},~{edx},~{dirflag},~{fpsr},~{flags}"(), !dbg !18, !srcloc !1941 ret i32 123, !dbg !1842 }43 44 ; Function Attrs: nounwind readnone speculatable45 declare void @llvm.dbg.value(metadata, metadata, metadata)46 47 !llvm.dbg.cu = !{!2}48 !llvm.module.flags = !{!7, !8, !9}49 !llvm.ident = !{!10}50 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: "/")55 !4 = !{}56 !5 = !{!0}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)70 !19 = !{i32 213}71 72...73---74name: foo75alignment: 1676tracksRegLiveness: true77liveins:78 - { reg: '$edi' }79body: |80 bb.0.entry:81 liveins: $edi82 83 DBG_VALUE $edi, $noreg, !15, !DIExpression(), debug-location !1884 DBG_VALUE $edi, $noreg, !15, !DIExpression(), debug-location !1885 DBG_VALUE $esi, $noreg, !16, !DIExpression(), debug-location !1886 DBG_VALUE $edx, $noreg, !17, !DIExpression(), debug-location !1887 renamable $edi = nsw INC32r killed renamable $edi, implicit-def dead $eflags, debug-location !1888 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 !1890 $eax = MOV32ri 123, debug-location !1891 RET64 killed $eax, debug-location !1892 93...94