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 0 // EOM(1)
49 ; CHECK-NEXT: .b8 0 // EOM(2)
50 ; CHECK-NEXT: .b8 0 // EOM(3)
52 ; CHECK-NEXT: .section .debug_info
54 ; CHECK-NEXT: .b32 34 // Length of Unit
55 ; CHECK-NEXT: .b8 2 // DWARF version number
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
63 ; CHECK-NEXT: .b8 98 // DW_AT_name
70 ; CHECK-NEXT: .b32 .debug_line // DW_AT_stmt_list
71 ; CHECK-NEXT: .b8 47 // DW_AT_comp_dir
84 ; CHECK-NEXT: .section .debug_macinfo { }
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")
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)