[Frontend] Remove unused includes (NFC) (#116927)
[llvm-project.git] / llvm / test / DebugInfo / NVPTX / debug-file-loc.ll
blob9d1d3506a3f1977bd4cce6790cda25480be3aac5
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 0                                   // EOM(1)
49 ; CHECK-NEXT: .b8 0                                   // EOM(2)
50 ; CHECK-NEXT: .b8 0                                   // EOM(3)
51 ; CHECK-NEXT:   }
52 ; CHECK-NEXT:   .section        .debug_info
53 ; CHECK-NEXT:   {
54 ; CHECK-NEXT: .b32 34                                 // Length of Unit
55 ; CHECK-NEXT: .b8 2                                   // DWARF version number
56 ; CHECK-NEXT: .b8 0
57 ; CHECK-NEXT: .b32 .debug_abbrev                      // Offset Into Abbrev. Section
58 ; CHECK-NEXT: .b8 8                                   // Address Size (in bytes)
59 ; CHECK-NEXT: .b8 1                                   // Abbrev [1] 0xb:0x1b DW_TAG_compile_unit
60 ; CHECK-NEXT: .b8 0                                   // DW_AT_producer
61 ; CHECK-NEXT: .b8 4                                   // DW_AT_language
62 ; CHECK-NEXT: .b8 0
63 ; CHECK-NEXT: .b8 98                                  // DW_AT_name
64 ; CHECK-NEXT: .b8 97
65 ; CHECK-NEXT: .b8 114
66 ; CHECK-NEXT: .b8 46
67 ; CHECK-NEXT: .b8 99
68 ; CHECK-NEXT: .b8 117
69 ; CHECK-NEXT: .b8 0
70 ; CHECK-NEXT: .b32 .debug_line                        // DW_AT_stmt_list
71 ; CHECK-NEXT: .b8 47                                  // DW_AT_comp_dir
72 ; CHECK-NEXT: .b8 115
73 ; CHECK-NEXT: .b8 111
74 ; CHECK-NEXT: .b8 117
75 ; CHECK-NEXT: .b8 114
76 ; CHECK-NEXT: .b8 99
77 ; CHECK-NEXT: .b8 101
78 ; CHECK-NEXT: .b8 47
79 ; CHECK-NEXT: .b8 100
80 ; CHECK-NEXT: .b8 105
81 ; CHECK-NEXT: .b8 114
82 ; CHECK-NEXT: .b8 0
83 ; CHECK-NEXT:   }
84 ; CHECK-NEXT:   .section        .debug_macinfo  {       }
85 ; CHECK-NOT: debug_
87 !llvm.dbg.cu = !{!0}
88 !llvm.module.flags = !{!8, !9}
90 !0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !1, producer: "", isOptimized: false, runtimeVersion: 0, emissionKind: LineTablesOnly, enums: !2)
91 !1 = !DIFile(filename: "bar.cu", directory: "/source/dir")
92 !2 = !{}
93 !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)
94 !5 = !DIFile(filename: "foo.h", directory: "/source/dir")
95 !6 = !DISubroutineType(types: !2)
96 !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)
97 !8 = !{i32 2, !"Dwarf Version", i32 2}
98 !9 = !{i32 2, !"Debug Info Version", i32 3}
99 !10 = !DILocation(line: 1, column: 31, scope: !4)
100 !11 = !DILocation(line: 2, column: 31, scope: !7)