| ; RUN: llc --verify-machineinstrs -O0 -mtriple=spirv64-unknown-unknown --spirv-ext=+SPV_KHR_non_semantic_info %s -o /dev/null 2>&1 | FileCheck %s --check-prefix=VERIFY |
| ; RUN: llc --verify-machineinstrs -O0 -mtriple=spirv64-unknown-unknown --spirv-ext=+SPV_KHR_non_semantic_info %s -o - | FileCheck %s --implicit-check-not=Debug |
| ; RUN: %if spirv-tools %{ llc --verify-machineinstrs --spirv-ext=+SPV_KHR_non_semantic_info -O0 -mtriple=spirv64-unknown-unknown %s -o - -filetype=obj | spirv-val %} |
| |
| ; DW_OP_bit_piece is the DWARF counterpart of NonSemantic.Shader.DebugInfo.100 |
| ; BitPiece (encoding 4). The IR verifier currently rejects it. |
| ; If rejected, the debug information is dropped, and llc continues the execution. |
| |
| ; Future implementation must be careful with the following: |
| ; DW_OP_bit_piece is (size, offset); NSDI BitPiece is (offset, size). |
| |
| ; VERIFY: invalid expression |
| ; VERIFY: !DIExpression(157, 32, 8) |
| ; VERIFY: warning: ignoring invalid debug info |
| |
| ; CHECK: OpFunction |
| |
| target triple = "spirv64-unknown-unknown" |
| |
| define spir_func void @f() !dbg !5 { |
| entry: |
| %x = alloca i32, align 4 |
| #dbg_declare(ptr %x, !9, !DIExpression(DW_OP_bit_piece, 32, 8), !10) |
| store i32 1, ptr %x, align 4, !dbg !10 |
| ret void, !dbg !10 |
| } |
| |
| !llvm.dbg.cu = !{!0} |
| !llvm.module.flags = !{!2, !3} |
| |
| !0 = distinct !DICompileUnit(language: DW_LANG_C99, file: !1, producer: "clang", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, splitDebugInlining: false, nameTableKind: None) |
| !1 = !DIFile(filename: "debug-expression-bit-piece.c", directory: "/src") |
| !2 = !{i32 7, !"Dwarf Version", i32 5} |
| !3 = !{i32 2, !"Debug Info Version", i32 3} |
| !4 = !DISubroutineType(types: !6) |
| !6 = !{null} |
| !7 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed) |
| !5 = distinct !DISubprogram(name: "f", linkageName: "f", scope: !1, file: !1, line: 1, type: !4, scopeLine: 1, flags: DIFlagPrototyped, spFlags: DISPFlagDefinition, unit: !0) |
| !9 = !DILocalVariable(name: "x", scope: !5, file: !1, line: 2, type: !7) |
| !10 = !DILocation(line: 3, column: 1, scope: !5) |