• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1// RUN: mlir-translate -mlir-to-llvmir %s | FileCheck %s
2
3// CHECK-LABEL: define void @func_no_debug()
4// CHECK-NOT: !dbg
5llvm.func @func_no_debug() {
6  llvm.return loc(unknown)
7} loc(unknown)
8
9// CHECK-LABEL: define void @func_with_debug()
10// CHECK-SAME: !dbg ![[FUNC_LOC:[0-9]+]]
11llvm.func @func_with_debug() {
12  // CHECK: call void @func_no_debug(), !dbg ![[CALLSITE_LOC:[0-9]+]]
13  llvm.call @func_no_debug() : () -> () loc(callsite("mysource.cc":3:4 at "mysource.cc":5:6))
14
15  // CHECK: call void @func_no_debug(), !dbg ![[FILE_LOC:[0-9]+]]
16  llvm.call @func_no_debug() : () -> () loc("foo.mlir":1:2)
17
18  // CHECK: call void @func_no_debug(), !dbg ![[NAMED_LOC:[0-9]+]]
19  llvm.call @func_no_debug() : () -> () loc("named"("foo.mlir":10:10))
20
21  // CHECK: call void @func_no_debug(), !dbg ![[FUSED_LOC:[0-9]+]]
22  llvm.call @func_no_debug() : () -> () loc(fused[callsite("mysource.cc":1:1 at "mysource.cc":5:6), "mysource.cc":1:1])
23
24  llvm.return
25} loc("foo.mlir":1:1)
26
27// CHECK-DAG: ![[FUNC_LOC]] = distinct !DISubprogram{{.*}}, line: 1
28// CHECK-DAG: ![[CALLSITE_LOC]] = !DILocation(line: 3, column: 4,
29// CHECK-DAG: ![[FILE_LOC]] = !DILocation(line: 1, column: 2,
30// CHECK-DAG: ![[NAMED_LOC]] = !DILocation(line: 10, column: 10
31// CHECK-DAG: ![[FUSED_LOC]] = !DILocation(line: 1, column: 1
32