xref: /llvm-project/llvm/test/DebugInfo/NVPTX/debug-name-table.ll (revision 2e7e0975c0017d2ca5b7563143df0bc8c9d3826d)
1; RUN: llc -mtriple=nvptx64-nvidia-cuda -mattr=+ptx75 < %s | FileCheck %s
2; RUN: %if ptxas-11.5 %{ llc -mtriple=nvptx64-nvidia-cuda -mattr=+ptx75 < %s | %ptxas-verify %}
3
4; DICompileUnit without 'nameTableKind: None' results in
5; debug_pubnames and debug_pubtypes sections in DWARF. These sections
6; use labels and label expressions, and ptxas requires PTX v7.5 to
7; support them.
8
9; CHECK-LABEL: .section .debug_pubnames
10; CHECK-NEXT: {
11; CHECK-NEXT: .b32 $L__pubNames_end0-$L__pubNames_start0
12; CHECK-NEXT: $L__pubNames_start0:
13; CHECK:      $L__pubNames_end0:
14; CHECK-NEXT: }
15
16; CHECK-LABEL: .section .debug_pubtypes
17; CHECK-NEXT: {
18; CHECK-NEXT: .b32 $L__pubTypes_end0-$L__pubTypes_start0
19; CHECK-NEXT: $L__pubTypes_start0:
20; CHECK:      $L__pubTypes_end0:
21; CHECK-NEXT: }
22
23; Function Attrs: nounwind ssp uwtable
24define i32 @foo() #0 !dbg !4 {
25entry:
26  ret i32 0
27}
28
29attributes #0 = { nounwind ssp uwtable }
30
31!llvm.dbg.cu = !{!0}
32!llvm.module.flags = !{!11, !12}
33!llvm.ident = !{!13}
34
35!0 = distinct !DICompileUnit(language: DW_LANG_C99, producer: "clang version 3.5.0 ", isOptimized: true, emissionKind: FullDebug, file: !1, enums: !2, retainedTypes: !2, globals: !2, imports: !2)
36!1 = !DIFile(filename: "debug-name-table.c", directory: "")
37!2 = !{}
38!4 = distinct !DISubprogram(name: "foo", line: 5, isLocal: false, isDefinition: true, virtualIndex: 6, isOptimized: true, unit: !0, scopeLine: 5, file: !1, scope: !5, type: !6)
39!5 = !DIFile(filename: "debug-name-table.c", directory: "")
40!6 = !DISubroutineType(types: !7)
41!7 = !{!8}
42!8 = !DIBasicType(tag: DW_TAG_base_type, name: "int", size: 32, align: 32, encoding: DW_ATE_signed)
43!11 = !{i32 2, !"Dwarf Version", i32 2}
44!12 = !{i32 1, !"Debug Info Version", i32 3}
45!13 = !{!"clang version 3.5.0 "}
46