Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / llvm / test / DebugInfo / NVPTX / debug-file-loc.ll
blob7386056d9da21ee6164ab30574bf2934056f7205
1 ; RUN: llc < %s -mtriple=nvptx64-nvidia-cuda | FileCheck %s
2 ; RUN: %if ptxas %{ llc < %s -mtriple=nvptx64-nvidia-cuda | %ptxas-verify %}
4 ; // Bitcode int this test case is reduced version of compiled code below:
5 ;extern "C" {
6 ;#line 1 "/source/dir/foo.h"
7 ;__device__ void foo() {}
8 ;#line 2 "/source/dir/bar.cu"
9 ;__device__ void bar() {}
12 ; CHECK: .target sm_{{[0-9]+}}, debug
14 ; CHECK: .visible .func foo()
15 ; CHECK: .loc [[FOO:[0-9]+]] 1 31
16 ; CHECK:  ret;
17 ; CHECK: .visible .func bar()
18 ; CHECK: .loc [[BAR:[0-9]+]] 2 31
19 ; CHECK:  ret;
21 define void @foo() !dbg !4 {
22 bb:
23   ret void, !dbg !10
26 define void @bar() !dbg !7 {
27 bb:
28   ret void, !dbg !11
31 ; CHECK-DAG: .file [[FOO]] "/source/dir{{/|\\\\}}foo.h"
32 ; CHECK-DAG: .file [[BAR]] "/source/dir{{/|\\\\}}bar.cu"
33 ; CHECK: .section .debug_abbrev
34 ; CHECK-NEXT: {
35 ; CHECK-NEXT: .b8 1                                // Abbreviation Code
36 ; CHECK-NEXT: .b8 17                               // DW_TAG_compile_unit
37 ; CHECK-NEXT: .b8 0                                // DW_CHILDREN_no
38 ; CHECK-NEXT: .b8 37                               // DW_AT_producer
39 ; CHECK-NEXT: .b8 8                                // DW_FORM_string
40 ; CHECK-NEXT: .b8 19                               // DW_AT_language
41 ; CHECK-NEXT: .b8 5                                // DW_FORM_data2
42 ; CHECK-NEXT: .b8 3                                // DW_AT_name
43 ; CHECK-NEXT: .b8 8                                // DW_FORM_string
44 ; CHECK-NEXT: .b8 16                               // DW_AT_stmt_list
45 ; CHECK-NEXT: .b8 6                                // DW_FORM_data4
46 ; CHECK-NEXT: .b8 27                               // DW_AT_comp_dir
47 ; CHECK-NEXT: .b8 8                                // DW_FORM_string
48 ; CHECK-NEXT: .b8 17                               // DW_AT_low_pc
49 ; CHECK-NEXT: .b8 1                                // DW_FORM_addr
50 ; CHECK-NEXT: .b8 18                               // DW_AT_high_pc
51 ; CHECK-NEXT: .b8 1                                // DW_FORM_addr
52 ; CHECK-NEXT: .b8 0                                // EOM(1)
53 ; CHECK-NEXT: .b8 0                                // EOM(2)
54 ; CHECK-NEXT: .b8 0                                // EOM(3)
55 ; CHECK-NEXT: }
56 ; CHECK-NEXT: .section .debug_info
57 ; CHECK-NEXT: {
58 ; CHECK-NEXT: .b32 50                              // Length of Unit
59 ; CHECK-NEXT: .b8 2                                // DWARF version number
60 ; CHECK-NEXT: .b8 0
61 ; CHECK-NEXT: .b32 .debug_abbrev                   // Offset Into Abbrev. Section
62 ; CHECK-NEXT: .b8 8                                // Address Size (in bytes)
63 ; CHECK-NEXT: .b8 1                                // Abbrev [1] 0xb:0x2b DW_TAG_compile_unit
64 ; CHECK-NEXT: .b8 0                                // DW_AT_producer
65 ; CHECK-NEXT: .b8 4                                // DW_AT_language
66 ; CHECK-NEXT: .b8 0
67 ; CHECK-NEXT: .b8 98                               // DW_AT_name
68 ; CHECK-NEXT: .b8 97
69 ; CHECK-NEXT: .b8 114
70 ; CHECK-NEXT: .b8 46
71 ; CHECK-NEXT: .b8 99
72 ; CHECK-NEXT: .b8 117
73 ; CHECK-NEXT: .b8 0
74 ; CHECK-NEXT: .b32 .debug_line                     // DW_AT_stmt_list
75 ; CHECK-NEXT: .b8 47                               // DW_AT_comp_dir
76 ; CHECK-NEXT: .b8 115
77 ; CHECK-NEXT: .b8 111
78 ; CHECK-NEXT: .b8 117
79 ; CHECK-NEXT: .b8 114
80 ; CHECK-NEXT: .b8 99
81 ; CHECK-NEXT: .b8 101
82 ; CHECK-NEXT: .b8 47
83 ; CHECK-NEXT: .b8 100
84 ; CHECK-NEXT: .b8 105
85 ; CHECK-NEXT: .b8 114
86 ; CHECK-NEXT: .b8 0
87 ; CHECK-NEXT: .b64 $L__func_begin0                 // DW_AT_low_pc
88 ; CHECK-NEXT: .b64 $L__func_end1                   // DW_AT_high_pc
89 ; CHECK-NEXT: }
90 ; CHECK-NEXT: .section .debug_loc { }
91 ; CHECK-NOT: debug_
93 !llvm.dbg.cu = !{!0}
94 !llvm.module.flags = !{!8, !9}
96 !0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !1, producer: "", isOptimized: false, runtimeVersion: 0, emissionKind: LineTablesOnly, enums: !2)
97 !1 = !DIFile(filename: "bar.cu", directory: "/source/dir")
98 !2 = !{}
99 !4 = distinct !DISubprogram(name: "foo", scope: !5, file: !5, line: 1, type: !6, isLocal: false, isDefinition: true, scopeLine: 1, flags: DIFlagPrototyped, isOptimized: false, unit: !0, retainedNodes: !2)
100 !5 = !DIFile(filename: "foo.h", directory: "/source/dir")
101 !6 = !DISubroutineType(types: !2)
102 !7 = distinct !DISubprogram(name: "bar", scope: !1, file: !1, line: 2, type: !6, isLocal: false, isDefinition: true, scopeLine: 2, flags: DIFlagPrototyped, isOptimized: false, unit: !0, retainedNodes: !2)
103 !8 = !{i32 2, !"Dwarf Version", i32 2}
104 !9 = !{i32 2, !"Debug Info Version", i32 3}
105 !10 = !DILocation(line: 1, column: 31, scope: !4)
106 !11 = !DILocation(line: 2, column: 31, scope: !7)