1 ; RUN: llc < %s -mtriple=nvptx64-nvidia-cuda | FileCheck %s
3 ; // Bitcode int this test case is reduced version of compiled code below:
5 ;#line 1 "/source/dir/foo.h"
6 ;__device__ void foo() {}
7 ;#line 2 "/source/dir/bar.cu"
8 ;__device__ void bar() {}
11 ; CHECK: .target sm_{{[0-9]+}}, debug
13 ; CHECK: .visible .func foo()
14 ; CHECK: .loc [[FOO:[0-9]+]] 1 31
16 ; CHECK: .visible .func bar()
17 ; CHECK: .loc [[BAR:[0-9]+]] 2 31
20 define void @foo() !dbg !4 {
25 define void @bar() !dbg !7 {
30 ; CHECK-DAG: .file [[FOO]] "{{.*}}foo.h"
31 ; CHECK-DAG: .file [[BAR]] "{{.*}}bar.cu"
32 ; CHECK: .section .debug_abbrev
34 ; CHECK-NEXT: .b8 1 // Abbreviation Code
35 ; CHECK-NEXT: .b8 17 // DW_TAG_compile_unit
36 ; CHECK-NEXT: .b8 0 // DW_CHILDREN_no
37 ; CHECK-NEXT: .b8 37 // DW_AT_producer
38 ; CHECK-NEXT: .b8 8 // DW_FORM_string
39 ; CHECK-NEXT: .b8 19 // DW_AT_language
40 ; CHECK-NEXT: .b8 5 // DW_FORM_data2
41 ; CHECK-NEXT: .b8 3 // DW_AT_name
42 ; CHECK-NEXT: .b8 8 // DW_FORM_string
43 ; CHECK-NEXT: .b8 16 // DW_AT_stmt_list
44 ; CHECK-NEXT: .b8 6 // DW_FORM_data4
45 ; CHECK-NEXT: .b8 27 // DW_AT_comp_dir
46 ; CHECK-NEXT: .b8 8 // DW_FORM_string
47 ; CHECK-NEXT: .b8 17 // DW_AT_low_pc
48 ; CHECK-NEXT: .b8 1 // DW_FORM_addr
49 ; CHECK-NEXT: .b8 18 // DW_AT_high_pc
50 ; CHECK-NEXT: .b8 1 // DW_FORM_addr
51 ; CHECK-NEXT: .b8 0 // EOM(1)
52 ; CHECK-NEXT: .b8 0 // EOM(2)
53 ; CHECK-NEXT: .b8 0 // EOM(3)
55 ; CHECK-NEXT: .section .debug_info
57 ; CHECK-NEXT: .b32 50 // Length of Unit
58 ; CHECK-NEXT: .b8 2 // DWARF version number
60 ; CHECK-NEXT: .b32 .debug_abbrev // Offset Into Abbrev. Section
61 ; CHECK-NEXT: .b8 8 // Address Size (in bytes)
62 ; CHECK-NEXT: .b8 1 // Abbrev [1] 0xb:0x2b DW_TAG_compile_unit
63 ; CHECK-NEXT: .b8 0 // DW_AT_producer
64 ; CHECK-NEXT: .b8 4 // DW_AT_language
66 ; CHECK-NEXT: .b8 98 // DW_AT_name
73 ; CHECK-NEXT: .b32 .debug_line // DW_AT_stmt_list
74 ; CHECK-NEXT: .b8 47 // DW_AT_comp_dir
86 ; CHECK-NEXT: .b64 Lfunc_begin0 // DW_AT_low_pc
87 ; CHECK-NEXT: .b64 Lfunc_end1 // DW_AT_high_pc
89 ; CHECK-NEXT: .section .debug_macinfo
91 ; CHECK-NEXT: .b8 0 // End Of Macro List Mark
95 !llvm.module.flags = !{!8, !9}
97 !0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !1, producer: "", isOptimized: false, runtimeVersion: 0, emissionKind: LineTablesOnly, enums: !2)
98 !1 = !DIFile(filename: "bar.cu", directory: "/source/dir")
100 !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)
101 !5 = !DIFile(filename: "foo.h", directory: "/source/dir")
102 !6 = !DISubroutineType(types: !2)
103 !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)
104 !8 = !{i32 2, !"Dwarf Version", i32 2}
105 !9 = !{i32 2, !"Debug Info Version", i32 3}
106 !10 = !DILocation(line: 1, column: 31, scope: !4)
107 !11 = !DILocation(line: 2, column: 31, scope: !7)