brintos

brintos / llvm-project-archived public Read only

0
0
Text · 4.8 KiB · 06a72c6 Raw
83 lines · plain
1# RUN: llc %s --start-after=livedebugvalues --filetype=obj -o - \2# RUN:     | llvm-dwarfdump - --name=test-var -o - | FileCheck %s3 4# Test that when an entry value expression appears in a DBG_VALUE_LIST, we are5# able to produce a valid entry value location in DWARF.6 7# CHECK: DW_OP_entry_value(DW_OP_reg14 R14), DW_OP_plus_uconst 0x10, DW_OP_plus_uconst 0x10, DW_OP_deref8 9--- |10  source_filename = "test.ll"11  target datalayout = "e-m:o-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"12  target triple = "x86_64-apple-macosx12.1.0"13 14  declare void @llvm.dbg.value(metadata, metadata, metadata)15 16  define swifttailcc void @blah(ptr swiftasync %0) !dbg !15 {17    %use = getelementptr i8, ptr %0, i64 918    call void @llvm.dbg.value(metadata ptr %0, metadata !18, metadata !DIExpression(DW_OP_LLVM_entry_value, 1, DW_OP_plus_uconst, 16, DW_OP_plus_uconst, 16, DW_OP_deref, DW_OP_deref)), !dbg !2219    %use1 = load i32, ptr null, align 4, !dbg !2720    %use2 = sext i32 %use1 to i6421    %use3 = getelementptr i8, ptr null, i64 %use222    store ptr %use3, ptr %0, align 823    ret void24  }25 26  !llvm.module.flags = !{!0}27  !llvm.dbg.cu = !{!1}28 29  !0 = !{i32 2, !"Debug Info Version", i32 3}30  !1 = distinct !DICompileUnit(language: DW_LANG_Swift, file: !2, producer: "blah", isOptimized: true, flags: "blah", runtimeVersion: 5, emissionKind: FullDebug, globals: !3, imports: !9, sysroot: "blah", sdk: "blah")31  !2 = !DIFile(filename: "blah", directory: "blah")32  !3 = !{!4, !10}33  !4 = !DIGlobalVariableExpression(var: !5, expr: !DIExpression())34  !5 = distinct !DIGlobalVariable(name: "blah", linkageName: "blah", scope: !6, file: !2, line: 49, type: !7, isLocal: true, isDefinition: true)35  !6 = !DIModule(scope: null, name: "blah", includePath: "blah")36  !7 = !DIDerivedType(tag: DW_TAG_const_type, baseType: !8)37  !8 = !DICompositeType(tag: DW_TAG_structure_type, name: "blah", scope: !6, file: !2, size: 64, elements: !9, runtimeLang: DW_LANG_Swift, identifier: "blah")38  !9 = !{}39  !10 = !DIGlobalVariableExpression(var: !11, expr: !DIExpression())40  !11 = distinct !DIGlobalVariable(name: "blah", linkageName: "blah", scope: !6, file: !2, line: 44, type: !12, isLocal: false, isDefinition: true)41  !12 = !DIDerivedType(tag: DW_TAG_const_type, baseType: !13)42  !13 = !DICompositeType(tag: DW_TAG_structure_type, name: "blah", scope: !14, file: !2, size: 64, elements: !9, runtimeLang: DW_LANG_Swift, identifier: "blah")43  !14 = !DIModule(scope: null, name: "blah", configMacros: "blah", includePath: "blah")44  !15 = distinct !DISubprogram(name: "blah", linkageName: "blah", scope: !16, file: !2, line: 115, type: !17, scopeLine: 117, spFlags: DISPFlagDefinition | DISPFlagOptimized, unit: !1, retainedNodes: !9, thrownTypes: !9)45  !16 = !DICompositeType(tag: DW_TAG_structure_type, name: "blah", scope: !6, file: !2, elements: !9, runtimeLang: DW_LANG_Swift, identifier: "blah")46  !17 = !DISubroutineType(types: !9)47  !18 = !DILocalVariable(name: "test-var", arg: 1, scope: !19, file: !2, line: 95, type: !21, flags: DIFlagArtificial)48  !19 = distinct !DISubprogram(name: "blah", linkageName: "blah", scope: !16, file: !2, line: 95, type: !20, scopeLine: 95, spFlags: DISPFlagDefinition | DISPFlagOptimized, unit: !1, retainedNodes: !9)49  !20 = distinct !DISubroutineType(types: !9)50  !21 = !DIDerivedType(tag: DW_TAG_const_type, baseType: !16)51  !22 = !DILocation(line: 95, column: 9, scope: !19, inlinedAt: !23)52  !23 = distinct !DILocation(line: 0, scope: !24, inlinedAt: !25)53  !24 = distinct !DISubprogram(name: "blah", linkageName: "blah", scope: !16, file: !2, type: !20, spFlags: DISPFlagDefinition | DISPFlagOptimized, unit: !1)54  !25 = distinct !DILocation(line: 121, column: 36, scope: !26)55  !26 = distinct !DILexicalBlock(scope: !15, file: !2, line: 116, column: 7)56  !27 = !DILocation(line: 0, scope: !28, inlinedAt: !23)57  !28 = !DILexicalBlockFile(scope: !19, file: !2, discriminator: 0)58 59...60---61name:            blah62alignment:       1663tracksRegLiveness: true64debugInstrRef:   true65tracksDebugUserValues: true66registers:       []67liveins:68  - { reg: '$r14', virtual-reg: '' }69frameInfo:70  maxAlignment:    171body:             |72  bb.0 (%ir-block.1):73    liveins: $r1474 75    DBG_PHI $r14, 176    DBG_INSTR_REF !18, !DIExpression(DW_OP_LLVM_arg, 0, DW_OP_LLVM_entry_value, 1, DW_OP_plus_uconst, 16, DW_OP_plus_uconst, 16, DW_OP_deref, DW_OP_deref), dbg-instr-ref(1, 0), debug-location !2277    DBG_VALUE_LIST !18, !DIExpression(DW_OP_LLVM_arg, 0, DW_OP_LLVM_entry_value, 1, DW_OP_plus_uconst, 16, DW_OP_plus_uconst, 16, DW_OP_deref, DW_OP_deref), $r14, debug-location !DILocation(line: 0, scope: !19, inlinedAt: !23)78    renamable $rax = MOVSX64rm32 $noreg, 1, $noreg, 0, $noreg, debug-location !27 :: (load (s32) from `ptr null`)79    MOV64mr killed renamable $r14, 1, $noreg, 0, $noreg, killed renamable $rax :: (store (s64) into %ir.0)80    RETI64 881 82...83