summaryrefslogtreecommitdiffstats
path: root/llvm/test/DebugInfo/X86/dwarf-no-source-loc.mir
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/test/DebugInfo/X86/dwarf-no-source-loc.mir')
-rw-r--r--llvm/test/DebugInfo/X86/dwarf-no-source-loc.mir74
1 files changed, 74 insertions, 0 deletions
diff --git a/llvm/test/DebugInfo/X86/dwarf-no-source-loc.mir b/llvm/test/DebugInfo/X86/dwarf-no-source-loc.mir
new file mode 100644
index 00000000000..f6ad6ee6d4c
--- /dev/null
+++ b/llvm/test/DebugInfo/X86/dwarf-no-source-loc.mir
@@ -0,0 +1,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