Home | History | Annotate | Download | only in GlobalISel
      1 # NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
      2 # RUN: llc -O0 -mtriple arm64-- -run-pass=instruction-select %s -o - | FileCheck %s
      3 
      4 --- |
      5   target datalayout = "e-m:o-i64:64-i128:128-n32:64-S128"
      6 
      7   define void @test_dbg_value(i32 %a) !dbg !5 {
      8     %tmp0 = add i32 %a, %a
      9     call void @llvm.dbg.value(metadata i32 %tmp0, i64 0, metadata !7, metadata !DIExpression()), !dbg !9
     10     ret void
     11   }
     12 
     13   define void @test_dbg_value_dead(i32 %a) !dbg !10 {
     14     call void @llvm.dbg.value(metadata i32 0, i64 0, metadata !11, metadata !DIExpression()), !dbg !12
     15     ret void
     16   }
     17 
     18   declare void @llvm.dbg.value(metadata, i64, metadata, metadata)
     19 
     20   !llvm.dbg.cu = !{!0}
     21   !llvm.module.flags = !{!3, !4}
     22 
     23   !0 = distinct !DICompileUnit(language: DW_LANG_C99, file: !1, producer: "llvm", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, enums: !2)
     24   !1 = !DIFile(filename: "test.ll", directory: "/tmp")
     25   !2 = !{}
     26   !3 = !{i32 2, !"Dwarf Version", i32 4}
     27   !4 = !{i32 2, !"Debug Info Version", i32 3}
     28   !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)
     29   !6 = !DISubroutineType(types: !2)
     30   !7 = !DILocalVariable(name: "in", arg: 1, scope: !5, file: !1, line: 1, type: !8)
     31   !8 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed)
     32   !9 = !DILocation(line: 1, column: 1, scope: !5)
     33   !10 = 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)
     34   !11 = !DILocalVariable(name: "in", arg: 1, scope: !10, file: !1, line: 1, type: !8)
     35   !12 = !DILocation(line: 1, column: 1, scope: !10)
     36 ...
     37 
     38 ---
     39 name:            test_dbg_value
     40 legalized:       true
     41 regBankSelected: true
     42 body: |
     43   bb.0:
     44     liveins: $w0
     45     ; CHECK-LABEL: name: test_dbg_value
     46     ; CHECK: [[COPY:%[0-9]+]]:gpr32 = COPY $w0
     47     ; CHECK: [[ADDWrr:%[0-9]+]]:gpr32 = ADDWrr [[COPY]], [[COPY]]
     48     ; CHECK: $w0 = COPY [[ADDWrr]]
     49     ; CHECK: DBG_VALUE debug-use [[ADDWrr]], debug-use $noreg, !7, !DIExpression(), debug-location !9
     50     %0:gpr(s32) = COPY $w0
     51     %1:gpr(s32) = G_ADD %0, %0
     52     $w0 = COPY %1(s32)
     53     DBG_VALUE debug-use %1(s32), debug-use $noreg, !7, !DIExpression(), debug-location !9
     54 ...
     55 
     56 ---
     57 name:            test_dbg_value_dead
     58 legalized:       true
     59 regBankSelected: true
     60 body: |
     61   bb.0:
     62     liveins: $w0
     63     ; CHECK-LABEL: name: test_dbg_value_dead
     64     ; CHECK-NOT: COPY
     65     ; CHECK: DBG_VALUE debug-use $noreg, debug-use $noreg, !7, !DIExpression(), debug-location !9
     66     %0:gpr(s32) = COPY $w0
     67     DBG_VALUE debug-use %0(s32), debug-use $noreg, !7, !DIExpression(), debug-location !9
     68 ...
     69