|
| 1 | +; RUN: llc < %s -mtriple=nvptx64-nvidia-cuda | FileCheck %s |
| 2 | + |
| 3 | +declare void @foo(i32) |
| 4 | + |
| 5 | +define void @test1(i32 noundef %gid) !dbg !3 { |
| 6 | +entry: |
| 7 | + ; |
| 8 | + ; verify that debug info exists for "xyz" variable |
| 9 | + ; |
| 10 | + ; CHECK-LABEL: DW_TAG_variable |
| 11 | + ; CHECK: .b8 120 // DW_AT_name |
| 12 | + ; CHECK-NEXT: .b8 121 |
| 13 | + ; CHECK-NEXT: .b8 122 |
| 14 | + ; CHECK-NEXT: .b8 0 |
| 15 | + ; CHECK-NEXT: .b8 1 // DW_AT_decl_file |
| 16 | + ; CHECK-NEXT: .b8 6 // DW_AT_decl_line |
| 17 | + ; |
| 18 | + %cmp = icmp eq i32 %gid, 0, !dbg !12 |
| 19 | + %conv = zext i1 %cmp to i32, !dbg !12 |
| 20 | + %conv1 = trunc i32 %conv to i8, !dbg !12 |
| 21 | + #dbg_value(i8 %conv1, !10, !DIExpression(), !13) |
| 22 | + %conv3 = sext i8 %conv1 to i32 |
| 23 | + call void @foo(i32 %conv3) |
| 24 | + ret void |
| 25 | +} |
| 26 | + |
| 27 | +!llvm.dbg.cu = !{!0} |
| 28 | +!llvm.module.flags = !{!2} |
| 29 | + |
| 30 | +!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !1, producer: "", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) |
| 31 | +!1 = !DIFile(filename: "test.cu", directory: "/source/dir") |
| 32 | +!2 = !{i32 1, !"Debug Info Version", i32 3} |
| 33 | +!3 = distinct !DISubprogram(name: "test1", linkageName: "_test1i", scope: !1, file: !1, line: 5, type: !4, scopeLine: 5, unit: !0, retainedNodes: !8) |
| 34 | +!4 = !DISubroutineType(types: !5) |
| 35 | +!5 = !{!6, !7} |
| 36 | +!6 = !DIBasicType(tag: DW_TAG_unspecified_type, name: "void") |
| 37 | +!7 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed) |
| 38 | +!8 = !{} |
| 39 | +!9 = distinct !DILexicalBlock(scope: !3, file: !1, line: 5, column: 30) |
| 40 | +!10 = !DILocalVariable(name: "xyz", scope: !9, file: !1, line: 6, type: !11) |
| 41 | +!11 = !DIBasicType(name: "bool", size: 8, encoding: DW_ATE_boolean) |
| 42 | +!12 = !DILocation(line: 1, column: 3, scope: !9) |
| 43 | +!13 = !DILocation(line: 2, scope: !9) |
0 commit comments