|
| 1 | +; RUN: llc --verify-machineinstrs --spv-emit-nonsemantic-debug-info --spirv-ext=+SPV_KHR_non_semantic_info --print-after=spirv-nonsemantic-debug-info -O0 -mtriple=spirv64-unknown-unknown %s -o - 2>&1 | FileCheck %s --check-prefix=CHECK-MIR |
| 2 | +; RUN: llc --verify-machineinstrs --spv-emit-nonsemantic-debug-info --spirv-ext=+SPV_KHR_non_semantic_info -O0 -mtriple=spirv64-unknown-unknown %s -o - | FileCheck %s --check-prefix=CHECK-SPIRV |
| 3 | +; RUN: llc --verify-machineinstrs -O0 -mtriple=spirv64-unknown-unknown --spirv-ext=+SPV_KHR_non_semantic_info %s -o - | FileCheck %s --check-prefix=CHECK-OPTION |
| 4 | +; RUN: %if spirv-tools %{ llc --verify-machineinstrs --spv-emit-nonsemantic-debug-info --spirv-ext=+SPV_KHR_non_semantic_info -O0 -mtriple=spirv64-unknown-unknown %s -o - -filetype=obj | spirv-val %} |
| 5 | + |
| 6 | +; CHECK-MIR-DAG: [[i32type:%[0-9]+\:type]] = OpTypeInt 32, 0 |
| 7 | +; CHECK-MIR-DAG: [[void_type:%[0-9]+\:type\(s64\)]] = OpTypeVoid |
| 8 | +; CHECK-MIR-DAG: [[i32_5:%[0-9]+\:iid]] = OpConstantI [[i32type]], 5 |
| 9 | +; CHECK-MIR-DAG: [[i32_1:%[0-9]+\:iid\(s32\)]] = OpConstantI [[i32type]], 1 |
| 10 | +; CHECK-MIR-DAG: [[i32_3:%[0-9]+\:iid\(s32\)]] = OpConstantI [[i32type]], 3 |
| 11 | +; CHECK-MIR-DAG: [[i32_13:%[0-9]+\:iid\(s32\)]] = OpConstantI [[i32type]], 13 |
| 12 | +; CHECK-MIR-DAG: [[debug_source:%[0-9]+\:id\(s32\)]] = OpExtInst [[void_type]], 3, 35 |
| 13 | +; CHECK-MIR-DAG: [[debug_comp_unit:%[0-9]+\:id\(s32\)]] = OpExtInst [[void_type]], 3, 1, [[i32_3]], [[i32_5]], [[debug_source]], [[i32_13]] |
| 14 | +; CHECK-MIR-DAG: [[debug_info_none:%[0-9]+\:id\(s32\)]] = OpExtInst [[void_type]], 3, 0 |
| 15 | +; CHECK-MIR-DAG: [[debug_imported_entity:%[0-9]+\:id\(s32\)]] = OpExtInst [[void_type]], 3, 34, {{%[0-9]+\:[a-z0-9\(\)]+}}, {{%[0-9]+\:[a-z0-9\(\)]+}}, [[debug_source]], [[debug_info_none]], [[i32_3]], [[i32_1]], [[debug_comp_unit]] |
| 16 | + |
| 17 | +; CHECK-SPIRV-DAG: [[i32type:%[0-9]+]] = OpTypeInt 32 0 |
| 18 | +; CHECK-SPIRV-DAG: [[void_type:%[0-9]+]] = OpTypeVoid |
| 19 | +; CHECK-SPIRV-DAG: [[debug_source:%[0-9]+]] = OpExtInst [[void_type]] {{%[0-9]+}} DebugSource |
| 20 | +; CHECK-SPIRV-DAG: [[debug_comp_unit:%[0-9]+]] = OpExtInst [[void_type]] {{%[0-9]+}} DebugCompilationUnit {{%[0-9]+}} {{%[0-9]+}} [[debug_source]] {{%[0-9]+}} |
| 21 | +; CHECK-SPIRV-DAG: [[debug_info_none:%[0-9]+]] = OpExtInst [[void_type]] {{%[0-9]+}} DebugInfoNone |
| 22 | +; CHECK-SPIRV-DAG: [[debug_imported_entity:%[0-9]+]] = OpExtInst [[void_type]] {{%[0-9]+}} DebugImportedEntity {{%[0-9]+}} {{%[0-9]+}} [[debug_source]] [[debug_info_none]] {{%[0-9]+}} {{%[0-9]+}} [[debug_comp_unit]] |
| 23 | + |
| 24 | +; CHECK-OPTION-NOT: DebugImportedEntity |
| 25 | + |
| 26 | +define dso_local noundef i32 @main() !dbg !13 { |
| 27 | +entry: |
| 28 | + %retval = alloca i32, align 4 |
| 29 | + %r = alloca i32, align 4 |
| 30 | + store i32 0, ptr %retval, align 4 |
| 31 | + #dbg_declare(ptr %r, !18, !DIExpression(), !19) |
| 32 | + %call = call noundef i32 @_ZN4myns9double_itEi(i32 noundef 5), !dbg !20 |
| 33 | + store i32 %call, ptr %r, align 4, !dbg !19 |
| 34 | + %0 = load i32, ptr %r, align 4, !dbg !21 |
| 35 | + ret i32 %0, !dbg !22 |
| 36 | +} |
| 37 | + |
| 38 | +declare noundef i32 @_ZN4myns9double_itEi(i32 noundef) |
| 39 | + |
| 40 | +!llvm.dbg.cu = !{!0} |
| 41 | +!llvm.module.flags = !{!5, !6, !7, !8, !9, !10, !11} |
| 42 | + |
| 43 | +!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus_14, file: !1, producer: "clang version XX.X", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, imports: !2, splitDebugInlining: false, nameTableKind: None) |
| 44 | +!1 = !DIFile(filename: "main.cpp", directory: "/tmp", checksumkind: CSK_MD5, checksum: "2ca3a2708747979970bbb428cfe8db65") |
| 45 | +!2 = !{!3} |
| 46 | +!3 = !DIImportedEntity(tag: DW_TAG_imported_module, scope: !0, entity: !4, file: !1, line: 3) |
| 47 | +!4 = !DINamespace(name: "myns", scope: null) |
| 48 | +!5 = !{i32 7, !"Dwarf Version", i32 5} |
| 49 | +!6 = !{i32 2, !"Debug Info Version", i32 3} |
| 50 | +!7 = !{i32 1, !"wchar_size", i32 4} |
| 51 | +!8 = !{i32 8, !"PIC Level", i32 2} |
| 52 | +!9 = !{i32 7, !"PIE Level", i32 2} |
| 53 | +!10 = !{i32 7, !"uwtable", i32 2} |
| 54 | +!11 = !{i32 7, !"frame-pointer", i32 2} |
| 55 | +!13 = distinct !DISubprogram(name: "main", scope: !1, file: !1, line: 5, type: !14, scopeLine: 5, flags: DIFlagPrototyped, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !17) |
| 56 | +!14 = !DISubroutineType(types: !15, flags: DIFlagPublic) |
| 57 | +!15 = !{!16} |
| 58 | +!16 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed, flags: DIFlagPublic) |
| 59 | +!17 = !{} |
| 60 | +!18 = !DILocalVariable(name: "r", scope: !13, file: !1, line: 6, type: !16) |
| 61 | +!19 = !DILocation(line: 6, column: 9, scope: !13) |
| 62 | +!20 = !DILocation(line: 6, column: 13, scope: !13) |
| 63 | +!21 = !DILocation(line: 7, column: 12, scope: !13) |
| 64 | +!22 = !DILocation(line: 7, column: 5, scope: !13) |
0 commit comments