|
| 1 | +; Check if the translator handles #dbg_declare(ptr null ...) correctly |
| 2 | + |
| 3 | +; RUN: llvm-as %s -o %t.bc |
| 4 | +; RUN: llvm-spirv %t.bc -o %t.spv |
| 5 | +; RUN: llvm-spirv %t.spv -to-text -o %t.spt |
| 6 | +; RUN: FileCheck < %t.spt %s --check-prefixes=CHECK-SPIRV |
| 7 | +; RUN: llvm-spirv -r %t.spv -o %t.rev.bc |
| 8 | +; RUN: llvm-dis < %t.rev.bc | FileCheck %s --check-prefix=CHECK-LLVM |
| 9 | + |
| 10 | +; RUN: llvm-as %s -o %t.bc |
| 11 | +; RUN: llvm-spirv %t.bc -o %t.spv --spirv-debug-info-version=nonsemantic-shader-100 |
| 12 | +; RUN: llvm-spirv %t.spv -to-text -o %t.spt |
| 13 | +; RUN: FileCheck < %t.spt %s --check-prefixes=CHECK-SPIRV |
| 14 | +; RUN: llvm-spirv -r %t.spv -o %t.rev.bc |
| 15 | +; RUN: llvm-dis < %t.rev.bc | FileCheck %s --check-prefix=CHECK-LLVM |
| 16 | + |
| 17 | +; RUN: llvm-as %s -o %t.bc |
| 18 | +; RUN: llvm-spirv %t.bc -o %t.spv --spirv-debug-info-version=nonsemantic-shader-200 |
| 19 | +; RUN: llvm-spirv %t.spv -to-text -o %t.spt |
| 20 | +; RUN: FileCheck < %t.spt %s --check-prefixes=CHECK-SPIRV |
| 21 | +; RUN: llvm-spirv -r %t.spv -o %t.rev.bc |
| 22 | +; RUN: llvm-dis < %t.rev.bc | FileCheck %s --check-prefix=CHECK-LLVM |
| 23 | + |
| 24 | +; CHECK-SPIRV: ExtInst [[#]] [[#None:]] [[#]] DebugInfoNone |
| 25 | +; CHECK-SPIRV: ExtInst [[#]] [[#LocalVar:]] [[#]] DebugLocalVariable |
| 26 | +; CHECK-SPIRV: ExtInst [[#]] [[#]] [[#]] DebugDeclare [[#LocalVar]] [[#None]] [[#]] |
| 27 | + |
| 28 | +; CHECK-LLVM: #dbg_declare(ptr poison, ![[#LocalVar:]], !DIExpression(DW_OP_constu, 4, DW_OP_swap, DW_OP_xderef), ![[#Loc:]]) |
| 29 | +; CHECK-LLVM-DAG: ![[#LocalVar]] = !DILocalVariable(name: "bar" |
| 30 | +; CHECK-LLVM-DAG: ![[#Loc]] = !DILocation(line: 23 |
| 31 | + |
| 32 | +; ModuleID = 'test.bc' |
| 33 | +target datalayout = "e-i64:64-v16:16-v24:32-v32:32-v48:64-v96:128-v192:256-v256:256-v512:512-v1024:1024-n8:16:32:64-G1" |
| 34 | +target triple = "spir64" |
| 35 | + |
| 36 | +define spir_kernel void @__omp_offloading_811_29c0007__Z4main_l28() { |
| 37 | +newFuncRoot: |
| 38 | + %0 = alloca i32, i32 0, align 4, !dbg !4 |
| 39 | + store i32 0, ptr null, align 4 |
| 40 | + %four.ascast.fpriv = alloca i32, align 4, !dbg !4 |
| 41 | + #dbg_declare(ptr null, !8, !DIExpression(DW_OP_constu, 4, DW_OP_swap, DW_OP_xderef), !10) |
| 42 | + ret void |
| 43 | +} |
| 44 | + |
| 45 | +!llvm.dbg.cu = !{!0} |
| 46 | +!llvm.module.flags = !{!3} |
| 47 | + |
| 48 | +!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus_14, file: !1, producer: "clang", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, imports: !2, splitDebugInlining: false, nameTableKind: None) |
| 49 | +!1 = !DIFile(filename: "test.cpp", directory: "/path/to") |
| 50 | +!2 = !{} |
| 51 | +!3 = !{i32 2, !"Debug Info Version", i32 3} |
| 52 | +!4 = !DILocation(line: 28, column: 1, scope: !5) |
| 53 | +!5 = distinct !DILexicalBlock(scope: !6, file: !1, line: 28, column: 1) |
| 54 | +!6 = distinct !DISubprogram(name: "foo", scope: !1, file: !1, line: 28, type: !7, scopeLine: 28, flags: DIFlagArtificial, spFlags: DISPFlagLocalToUnit | DISPFlagDefinition, unit: !0) |
| 55 | +!7 = !DISubroutineType(types: !2) |
| 56 | +!8 = !DILocalVariable(name: "bar", scope: !5, file: !1, line: 23, type: !9) |
| 57 | +!9 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed) |
| 58 | +!10 = !DILocation(line: 23, column: 7, scope: !5) |
| 59 | + |
0 commit comments