1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-22 18:54:02 +01:00
llvm-mirror/test/Bitcode/DIModule-fortran-module.ll
Sourabh Singh Tomar 99bc9bdea6 [DebugInfo] Fortran module DebugInfo support in LLVM
This patch extends DIModule Debug metadata in LLVM to support
Fortran modules. DIModule is extended to contain File and Line
fields, these fields will be used by Flang FE to create debug
information necessary for representing Fortran modules at IR level.

Furthermore DW_TAG_module is also extended to contain these fields.
If these fields are missing, debuggers like GDB won't be able to
show Fortran modules information correctly.

Reviewed By: aprantl

Differential Revision: https://reviews.llvm.org/D79484
2020-05-13 12:52:30 +05:30

35 lines
1.4 KiB
LLVM

; RUN: llvm-dis -o - %s.bc | FileCheck %s
; CHECK: DIModule(scope: !4, name: "dummy", file: !3, line: 2)
; ModuleID = 'DIModule-fortran-module.bc'
source_filename = "/tmp/module-b198fa.ll"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"
%struct_dummy_0_ = type <{ [4 x i8] }>
@_dummy_0_ = common global %struct_dummy_0_ zeroinitializer, align 64, !dbg !0
; Function Attrs: noinline
define float @dummy_() #0 {
.L.entry:
ret float undef
}
attributes #0 = { noinline "target-cpu"="x86-64" "target-features"="+cx8,+fxsr,+mmx,+sse,+sse2,+x87" }
!llvm.module.flags = !{!8, !9}
!llvm.dbg.cu = !{!4}
!0 = !DIGlobalVariableExpression(var: !1, expr: !DIExpression())
!1 = distinct !DIGlobalVariable(name: "foo", scope: !2, file: !3, type: !7, isLocal: false, isDefinition: true)
!2 = !DIModule(scope: !4, name: "dummy", file: !3, line: 2)
!3 = !DIFile(filename: "module.f90", directory: "/fortran")
!4 = distinct !DICompileUnit(language: DW_LANG_Fortran90, file: !3, producer: " F90 Flang - 1.5 2017-05-01", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, enums: !5, retainedTypes: !5, globals: !6, imports: !5)
!5 = !{}
!6 = !{!0}
!7 = !DIBasicType(name: "integer", size: 32, align: 32, encoding: DW_ATE_signed)
!8 = !{i32 2, !"Dwarf Version", i32 4}
!9 = !{i32 2, !"Debug Info Version", i32 3}