|
| 1 | +;; Tests for Fortran's complex type encoding in debug info |
| 2 | +;; Compiled from the following Fortran source |
| 3 | +;; |
| 4 | +;; program complex_numbers |
| 5 | +;; implicit none |
| 6 | +;; complex :: a, b, c |
| 7 | +;; |
| 8 | +;; a = (1.0, 2.0) |
| 9 | +;; b = (2.0, -1.0) |
| 10 | +;; |
| 11 | +;; c = a + b |
| 12 | +;; |
| 13 | +;; end program complex_numbers |
| 14 | + |
| 15 | +; RUN: llvm-as %s -o %t.bc |
| 16 | +; RUN: llvm-spirv %t.bc -spirv-text --spirv-debug-info-version=nonsemantic-shader-200 -o - | FileCheck %s --check-prefix=CHECK-SPIRV-200 |
| 17 | +; RUN: llvm-spirv %t.bc -o %t.spv --spirv-debug-info-version=nonsemantic-shader-200 |
| 18 | +; RUN: llvm-spirv -r -emit-opaque-pointers %t.spv -o %t.rev.bc |
| 19 | +; RUN: llvm-dis %t.rev.bc -o - | FileCheck %s --check-prefix=CHECK-LLVM-200 |
| 20 | + |
| 21 | +; RUN: llvm-spirv %t.bc -spirv-text --spirv-debug-info-version=nonsemantic-shader-100 -o - | FileCheck %s --check-prefix=CHECK-SPIRV-100 |
| 22 | +; RUN: llvm-spirv %t.bc -o %t.spv --spirv-debug-info-version=nonsemantic-shader-100 |
| 23 | +; RUN: llvm-spirv -r -emit-opaque-pointers %t.spv -o %t.rev.bc |
| 24 | +; RUN: llvm-dis %t.rev.bc -o - | FileCheck %s --check-prefix=CHECK-LLVM-100 |
| 25 | + |
| 26 | +; CHECK-SPIRV-200-DAG: ExtInstImport [[#Import:]] "NonSemantic.Shader.DebugInfo.200 |
| 27 | +; CHECK-SPIRV-200-DAG: String [[#Name:]] "COMPLEX*8" |
| 28 | +; CHECK-SPIRV-200-DAG: Constant [[#]] [[#Size:]] 64 |
| 29 | +; CHECK-SPIRV-200-DAG: Constant [[#]] [[#Encoding:]] 8 |
| 30 | +; CHECK-SPIRV-200-DAG: ExtInst [[#]] [[#Type:]] [[#Import]] DebugTypeBasic [[#Name]] [[#Size]] [[#Encoding]] |
| 31 | +; CHECK-SPIRV-200-DAG: ExtInst [[#]] [[#]] [[#Import]] DebugLocalVariable [[#]] [[#Type]] |
| 32 | +; CHECK-SPIRV-200-DAG: ExtInst [[#]] [[#]] [[#Import]] DebugLocalVariable [[#]] [[#Type]] |
| 33 | +; CHECK-SPIRV-200-DAG: ExtInst [[#]] [[#]] [[#Import]] DebugLocalVariable [[#]] [[#Type]] |
| 34 | + |
| 35 | +; CHECK-LLVM-200: ![[#]] = !DILocalVariable(name: "a", scope: ![[#]], file: ![[#]], line: [[#]], type: ![[#Type:]]) |
| 36 | +; CHECK-LLVM-200: ![[#Type]] = !DIBasicType(name: "COMPLEX*8", size: 64, encoding: DW_ATE_complex_float) |
| 37 | +; CHECK-LLVM-200: ![[#]] = !DILocalVariable(name: "b", scope: ![[#]], file: ![[#]], line: [[#]], type: ![[#Type]]) |
| 38 | +; CHECK-LLVM-200: ![[#]] = !DILocalVariable(name: "c", scope: ![[#]], file: ![[#]], line: [[#]], type: ![[#Type]]) |
| 39 | + |
| 40 | +; CHECK-SPIRV-100-DAG: ExtInstImport [[#Import:]] "NonSemantic.Shader.DebugInfo.100 |
| 41 | +; CHECK-SPIRV-100-DAG: String [[#Name:]] "COMPLEX*8" |
| 42 | +; CHECK-SPIRV-100-DAG: Constant [[#]] [[#Size:]] 64 |
| 43 | +; CHECK-SPIRV-100-DAG: Constant [[#]] [[#Encoding:]] 0 |
| 44 | +; CHECK-SPIRV-100-DAG: ExtInst [[#]] [[#Type:]] [[#Import]] DebugTypeBasic [[#Name]] [[#Size]] [[#Encoding]] |
| 45 | +; CHECK-SPIRV-100-DAG: ExtInst [[#]] [[#]] [[#Import]] DebugLocalVariable [[#]] [[#Type]] |
| 46 | +; CHECK-SPIRV-100-DAG: ExtInst [[#]] [[#]] [[#Import]] DebugLocalVariable [[#]] [[#Type]] |
| 47 | +; CHECK-SPIRV-100-DAG: ExtInst [[#]] [[#]] [[#Import]] DebugLocalVariable [[#]] [[#Type]] |
| 48 | + |
| 49 | +; CHECK-LLVM-100: ![[#]] = !DILocalVariable(name: "a", scope: ![[#]], file: ![[#]], line: [[#]], type: ![[#Type:]]) |
| 50 | +; CHECK-LLVM-100: ![[#Type]] = !DIBasicType(tag: DW_TAG_unspecified_type, name: "COMPLEX*8") |
| 51 | +; CHECK-LLVM-100: ![[#]] = !DILocalVariable(name: "b", scope: ![[#]], file: ![[#]], line: [[#]], type: ![[#Type]]) |
| 52 | +; CHECK-LLVM-100: ![[#]] = !DILocalVariable(name: "c", scope: ![[#]], file: ![[#]], line: [[#]], type: ![[#Type]]) |
| 53 | + |
| 54 | +; ModuleID = 'test.f90' |
| 55 | +source_filename = "test.f90" |
| 56 | +target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" |
| 57 | +target triple = "spir64-unknown-unknown" |
| 58 | + |
| 59 | +@0 = internal unnamed_addr constant i32 65536, align 4 |
| 60 | +@1 = internal unnamed_addr constant i32 2, align 4 |
| 61 | + |
| 62 | +; Function Attrs: nounwind uwtable |
| 63 | +define void @MAIN__() local_unnamed_addr !dbg !4 !llfort.type_idx !12 { |
| 64 | +alloca_0: |
| 65 | + %func_result = tail call i32 @for_set_fpe_(ptr nonnull @0), !dbg !13, !llfort.type_idx !14 |
| 66 | + %func_result2 = tail call i32 @for_set_reentrancy(ptr nonnull @1), !dbg !13, !llfort.type_idx !14 |
| 67 | + call void @llvm.dbg.value(metadata float 1.000000e+00, metadata !11, metadata !DIExpression(DW_OP_LLVM_fragment, 0, 32)), !dbg !15 |
| 68 | + call void @llvm.dbg.value(metadata float 2.000000e+00, metadata !11, metadata !DIExpression(DW_OP_LLVM_fragment, 32, 32)), !dbg !15 |
| 69 | + call void @llvm.dbg.value(metadata float 2.000000e+00, metadata !10, metadata !DIExpression(DW_OP_LLVM_fragment, 0, 32)), !dbg !15 |
| 70 | + call void @llvm.dbg.value(metadata float -1.000000e+00, metadata !10, metadata !DIExpression(DW_OP_LLVM_fragment, 32, 32)), !dbg !15 |
| 71 | + call void @llvm.dbg.value(metadata float poison, metadata !8, metadata !DIExpression(DW_OP_LLVM_fragment, 0, 32)), !dbg !15 |
| 72 | + call void @llvm.dbg.value(metadata float poison, metadata !8, metadata !DIExpression(DW_OP_LLVM_fragment, 32, 32)), !dbg !15 |
| 73 | + ret void, !dbg !16 |
| 74 | +} |
| 75 | + |
| 76 | +declare !llfort.intrin_id !17 !llfort.type_idx !18 i32 @for_set_fpe_(ptr nocapture readonly) local_unnamed_addr |
| 77 | + |
| 78 | +; Function Attrs: nofree |
| 79 | +declare !llfort.intrin_id !19 !llfort.type_idx !20 i32 @for_set_reentrancy(ptr nocapture readonly) local_unnamed_addr |
| 80 | + |
| 81 | +; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) |
| 82 | +declare void @llvm.dbg.value(metadata, metadata, metadata) |
| 83 | + |
| 84 | +!llvm.module.flags = !{!0, !1} |
| 85 | +!llvm.dbg.cu = !{!2} |
| 86 | +!omp_offload.info = !{} |
| 87 | + |
| 88 | +!0 = !{i32 2, !"Debug Info Version", i32 3} |
| 89 | +!1 = !{i32 2, !"Dwarf Version", i32 4} |
| 90 | +!2 = distinct !DICompileUnit(language: DW_LANG_Fortran95, file: !3, producer: "Intel(R) Fortran", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, splitDebugInlining: false, nameTableKind: None) |
| 91 | +!3 = !DIFile(filename: "test.f90", directory: "complex") |
| 92 | +!4 = distinct !DISubprogram(name: "complex_numbers", linkageName: "MAIN__", scope: !3, file: !3, line: 1, type: !5, scopeLine: 1, spFlags: DISPFlagDefinition | DISPFlagMainSubprogram, unit: !2, retainedNodes: !7) |
| 93 | +!5 = !DISubroutineType(types: !6) |
| 94 | +!6 = !{null} |
| 95 | +!7 = !{!8, !10, !11} |
| 96 | +!8 = !DILocalVariable(name: "c", scope: !4, file: !3, line: 3, type: !9) |
| 97 | +!9 = !DIBasicType(name: "COMPLEX*8", size: 64, encoding: DW_ATE_complex_float) |
| 98 | +!10 = !DILocalVariable(name: "b", scope: !4, file: !3, line: 3, type: !9) |
| 99 | +!11 = !DILocalVariable(name: "a", scope: !4, file: !3, line: 3, type: !9) |
| 100 | +!12 = !{i64 23} |
| 101 | +!13 = !DILocation(line: 1, column: 9, scope: !4) |
| 102 | +!14 = !{i64 2} |
| 103 | +!15 = !DILocation(line: 0, scope: !4) |
| 104 | +!16 = !DILocation(line: 9, column: 1, scope: !4) |
| 105 | +!17 = !{i32 97} |
| 106 | +!18 = !{i64 27} |
| 107 | +!19 = !{i32 98} |
| 108 | +!20 = !{i64 29} |
0 commit comments