summaryrefslogtreecommitdiffstats
path: root/llvm/test/DebugInfo/X86/dwarf-no-source-loc.mir
blob: f6ad6ee6d4c8d98e1f9b65d05f378cccf2f24eaa (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
# RUN: llc -o - %s -start-before=patchable-function -use-unknown-locations=Default | FileCheck %s --check-prefixes=CHECK,DEFAULT
# RUN: llc -o - %s -start-before=patchable-function -use-unknown-locations=Enable | FileCheck %s --check-prefixes=CHECK,ENABLE
# RUN: llc -o - %s -start-before=patchable-function -use-unknown-locations=Disable | FileCheck %s --check-prefixes=CHECK,DISABLE
--- |
  target triple = "x86_64--"
  
  !0 = !DIFile(filename: "dwarf-no-source-loc.mir", directory: "/")
  !1 = distinct !DICompileUnit(file: !0, language: DW_LANG_C, emissionKind: LineTablesOnly)
  !2 = distinct !DISubprogram(name: "func", unit: !1)
  !3 = !DILocation(line: 17, scope: !2)
  !4 = !DILocation(line: 42, scope: !2)

  !llvm.dbg.cu = !{!1}
  !llvm.module.flags = !{!10, !11}
  !10 = !{i32 2, !"Dwarf Version", i32 4}
  !11 = !{i32 2, !"Debug Info Version", i32 3}
  
  define void @func() !dbg !2 {
    unreachable
  }
...
---
name: func
body: |
  bb.0:
    NOOP
    NOOP
    $eax = MOV32ri 1, debug-location !3
    ; CHECK-LABEL: bb.0
    ; CHECK: nop
    ; CHECK: nop
    ; CHECK: .loc 1 17 0 prologue_end
    ; CHECK: movl $1, %eax

  bb.1:
    NOOP
    $ebx = MOV32ri 2, debug-location !4
    ; CHECK-LABEL: bb.1
    ; DEFAULT: .loc 1 42 0
    ; ENABLE: .loc 1 0
    ; DISABLE-NOT: .loc 1 0
    ; CHECK: nop
    ; ENABLE: .loc 1 42 0
    ; CHECK: movl $2, %ebx

  bb.2:
    NOOP
    ; CHECK-LABEL: bb.2
    ; DEFAULT: .loc 1 0 0 is_stmt 0
    ; ENABLE: .loc 1 0 0 is_stmt 0
    ; DISABLE-NOT: .loc 1 0
    ; CHECK: nop

  bb.3:
    NOOP
    $ecx = MOV32ri 3, debug-location !3
    ; CHECK-LABEL: bb.3
    ; CHECK: nop
    ; DEFAULT: .loc 1 17 0 is_stmt 1
    ; ENABLE: .loc 1 17 0 is_stmt 1
    ; DISABLE-NOT: .loc 1 0
    ; CHECK: movl $3, %ecx

  bb.4:
    NOOP
    $edx = MOV32ri 4, debug-location !4
    ; CHECK: bb.4
    ; DEFAULT: .loc 1 42 0
    ; ENABLE: .loc 1 0 0 is_stmt 0
    ; DISABLE-NOT: .loc 1 0
    ; CHECK: nop
    ; ENABLE: .loc 1 42 0 is_stmt 1
    ; CHECK: movl $4, %edx
...
OpenPOWER on IntegriCloud