4
4
// CHECK: llvm.return loc(#loc
5
5
// CHECK: loc(#loc[[LOC:[0-9]+]])
6
6
// CHECK: #di_file = #llvm.di_file<"<unknown>" in "">
7
- // CHECK: #di_subprogram = #llvm.di_subprogram<compileUnit = #di_compile_unit, scope = #di_file, name = "func_no_debug", linkageName = "func_no_debug", file = #di_file, line = 1, scopeLine = 1, subprogramFlags = "Definition|Optimized", type = #di_subroutine_type>
7
+ // CHECK: #di_subprogram = #llvm.di_subprogram<id = distinct[{{.*}}]<>, compileUnit = #di_compile_unit, scope = #di_file, name = "func_no_debug", linkageName = "func_no_debug", file = #di_file, line = 1, scopeLine = 1, subprogramFlags = "Definition|Optimized", type = #di_subroutine_type>
8
8
// CHECK: #loc[[LOC]] = loc(fused<#di_subprogram>
9
9
module {
10
10
llvm.func @func_no_debug () {
@@ -14,12 +14,22 @@ module {
14
14
15
15
// -----
16
16
17
+ // Test that the declarations subprogram is not made distinct.
18
+ // CHECK-LABEL: llvm.func @func_decl_no_debug()
19
+ // CHECK: #di_subprogram = #llvm.di_subprogram<
20
+ // CHECK-NOT: id = distinct
21
+ module {
22
+ llvm.func @func_decl_no_debug () loc (unknown )
23
+ } loc (unknown )
24
+
25
+ // -----
26
+
17
27
// Test that existing debug info is not overwritten.
18
28
// CHECK-LABEL: llvm.func @func_with_debug()
19
29
// CHECK: llvm.return loc(#loc
20
30
// CHECK: loc(#loc[[LOC:[0-9]+]])
21
31
// CHECK: #di_file = #llvm.di_file<"<unknown>" in "">
22
- // CHECK: #di_subprogram = #llvm.di_subprogram<compileUnit = #di_compile_unit, scope = #di_file, name = "func_with_debug", linkageName = "func_with_debug", file = #di_file, line = 42, scopeLine = 42, subprogramFlags = "Definition|Optimized", type = #di_subroutine_type>
32
+ // CHECK: #di_subprogram = #llvm.di_subprogram<id = distinct[{{.*}}]<>, compileUnit = #di_compile_unit, scope = #di_file, name = "func_with_debug", linkageName = "func_with_debug", file = #di_file, line = 42, scopeLine = 42, subprogramFlags = "Definition|Optimized", type = #di_subroutine_type>
23
33
// CHECK: #loc[[LOC]] = loc(fused<#di_subprogram>
24
34
module {
25
35
llvm.func @func_with_debug () {
@@ -31,7 +41,7 @@ module {
31
41
#loc = loc (" foo" :0 :0 )
32
42
#loc1 = loc (unknown )
33
43
#di_compile_unit = #llvm.di_compile_unit <id = distinct [0 ]<>, sourceLanguage = DW_LANG_C , file = #di_file , producer = " MLIR" , isOptimized = true , emissionKind = LineTablesOnly >
34
- #di_subprogram = #llvm.di_subprogram <compileUnit = #di_compile_unit , scope = #di_file , name = " func_with_debug" , linkageName = " func_with_debug" , file = #di_file , line = 42 , scopeLine = 42 , subprogramFlags = " Definition|Optimized" , type = #di_subroutine_type >
44
+ #di_subprogram = #llvm.di_subprogram <id = distinct [ 1 ]<>, compileUnit = #di_compile_unit , scope = #di_file , name = " func_with_debug" , linkageName = " func_with_debug" , file = #di_file , line = 42 , scopeLine = 42 , subprogramFlags = " Definition|Optimized" , type = #di_subroutine_type >
35
45
#loc2 = loc (fused <#di_subprogram >[#loc1 ])
36
46
37
47
// -----
@@ -44,8 +54,8 @@ module {
44
54
// CHECK-DAG: #[[DI_FILE_MODULE:.+]] = #llvm.di_file<"bar.mlir" in "baz">
45
55
// CHECK-DAG: #[[DI_FILE_FUNC:.+]] = #llvm.di_file<"file.mlir" in "">
46
56
// CHECK-DAG: #loc[[FUNCFILELOC:[0-9]+]] = loc("file.mlir":9:8)
47
- // CHECK-DAG: #di_compile_unit = #llvm.di_compile_unit<id = distinct[0 ]<>, sourceLanguage = DW_LANG_C, file = #[[DI_FILE_MODULE]], producer = "MLIR", isOptimized = true, emissionKind = LineTablesOnly>
48
- // CHECK-DAG: #di_subprogram = #llvm.di_subprogram<compileUnit = #di_compile_unit, scope = #[[DI_FILE_FUNC]], name = "propagate_compile_unit", linkageName = "propagate_compile_unit", file = #[[DI_FILE_FUNC]], line = 9, scopeLine = 8, subprogramFlags = "Definition|Optimized", type = #di_subroutine_type>
57
+ // CHECK-DAG: #di_compile_unit = #llvm.di_compile_unit<id = distinct[{{.*}} ]<>, sourceLanguage = DW_LANG_C, file = #[[DI_FILE_MODULE]], producer = "MLIR", isOptimized = true, emissionKind = LineTablesOnly>
58
+ // CHECK-DAG: #di_subprogram = #llvm.di_subprogram<id = distinct[{{.*}}]<>, compileUnit = #di_compile_unit, scope = #[[DI_FILE_FUNC]], name = "propagate_compile_unit", linkageName = "propagate_compile_unit", file = #[[DI_FILE_FUNC]], line = 9, scopeLine = 8, subprogramFlags = "Definition|Optimized", type = #di_subroutine_type>
49
59
// CHECK-DAG: #loc[[MODULELOC]] = loc(fused<#di_compile_unit>[#loc])
50
60
// CHECK-DAG: #loc[[FUNCLOC]] = loc(fused<#di_subprogram>[#loc[[FUNCFILELOC]]
51
61
module {
0 commit comments