1# RUN: llc -O0 -mtriple arm64-- -run-pass=regbankselect %s -o - | FileCheck %s 2 3--- | 4 target datalayout = "e-m:o-i64:64-i128:128-n32:64-S128" 5 6 define void @test_dbg_value() !dbg !5 { 7 ; Keep the dbg metadata live by referencing it in the IR. 8 call void @llvm.dbg.value(metadata i32 0, i64 0, metadata !7, metadata !DIExpression()), !dbg !9 9 ret void 10 } 11 12 declare void @llvm.dbg.value(metadata, i64, metadata, metadata) 13 14 !llvm.dbg.cu = !{!0} 15 !llvm.module.flags = !{!3, !4} 16 17 !0 = distinct !DICompileUnit(language: DW_LANG_C99, file: !1, producer: "llvm", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, enums: !2) 18 !1 = !DIFile(filename: "test.ll", directory: "/tmp") 19 !2 = !{} 20 !3 = !{i32 2, !"Dwarf Version", i32 4} 21 !4 = !{i32 2, !"Debug Info Version", i32 3} 22 !5 = distinct !DISubprogram(name: "test_dbg_value", scope: !1, file: !1, line: 1, type: !6, isLocal: false, isDefinition: true, scopeLine: 1, flags: DIFlagPrototyped, isOptimized: false, unit: !0, retainedNodes: !2) 23 !6 = !DISubroutineType(types: !2) 24 !7 = !DILocalVariable(name: "in", arg: 1, scope: !5, file: !1, line: 1, type: !8) 25 !8 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed) 26 !9 = !DILocation(line: 1, column: 1, scope: !5) 27... 28 29--- 30# CHECK-LABEL: name: test_dbg_value 31name: test_dbg_value 32legalized: true 33# CHECK: registers: 34# CHECK-NEXT: - { id: 0, class: gpr, preferred-register: '' } 35body: | 36 bb.0: 37 liveins: $w0 38 %0:_(s32) = COPY $w0 39 ; CHECK: DBG_VALUE debug-use %0(s32), debug-use $noreg, !7, !DIExpression(), debug-location !9 40 DBG_VALUE debug-use %0(s32), debug-use $noreg, !7, !DIExpression(), debug-location !9 41 42 ; CHECK: DBG_VALUE $noreg, 0, !7, !DIExpression(), debug-location !9 43 DBG_VALUE $noreg, 0, !7, !DIExpression(), debug-location !9 44... 45