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:
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
17 ; CHECK: .visible .func bar()
18 ; CHECK: .loc [[BAR:[0-9]+]] 2 31
21 define void @foo() !dbg !4 {
26 define void @bar() !dbg !7 {
31 ; CHECK-DAG: .file [[FOO]] "/source/dir{{/|\\\\}}foo.h"
32 ; CHECK-DAG: .file [[BAR]] "/source/dir{{/|\\\\}}bar.cu"
33 ; CHECK: .section .debug_abbrev
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)
56 ; CHECK-NEXT: .section .debug_info
58 ; CHECK-NEXT: .b32 50 // Length of Unit
59 ; CHECK-NEXT: .b8 2 // DWARF version number
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
67 ; CHECK-NEXT: .b8 98 // DW_AT_name
74 ; CHECK-NEXT: .b32 .debug_line // DW_AT_stmt_list
75 ; CHECK-NEXT: .b8 47 // DW_AT_comp_dir
87 ; CHECK-NEXT: .b64 $L__func_begin0 // DW_AT_low_pc
88 ; CHECK-NEXT: .b64 $L__func_end1 // DW_AT_high_pc
90 ; CHECK-NEXT: .section .debug_loc { }
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")
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)