Debian Codegraph @

llvm-project/llvm/projects/llvm-spirv/test/DebugInfo/X86/Fortran-DIModule.ll

raw
1 ; This test checks attributes of a Fortran module.
2 ; RUN: llvm-as < %s -o %t.bc
3 ; RUN: llvm-spirv --spirv-ext=+SPV_INTEL_debug_module %t.bc -o %t.spv
4 ; RUN: llvm-spirv -r -emit-opaque-pointers %t.spv -o - | llvm-dis -o %t.ll
5
6 ; RUN: llc -mtriple=x86_64-unknown-linux-gnu %t.ll -filetype=obj -o - | \
7 ; RUN: llvm-dwarfdump - | FileCheck %s
8
9 ; CHECK: DW_TAG_module
10 ; CHECK-NEXT: DW_AT_name ("dummy")
11 ; CHECK-NEXT: DW_AT_decl_file ("/fortran{{[/\\]}}module.f90")
12 ; CHECK-NEXT: DW_AT_decl_line (2)
13
14 ; Generated from flang compiler, Fortran source to regenerate:
15 ; module dummy
16 ; integer :: foo
17 ; end module dummy
18
19 ; ModuleID = '/tmp/module-b198fa.ll'
20 source_filename = "/tmp/module-b198fa.ll"
21 target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
22 target triple = "spir64-unknown-unknown"
23
24 %struct_dummy_0_ = type <{ [4 x i8] }>
25
26 @_dummy_0_ = common addrspace(1) global %struct_dummy_0_ zeroinitializer, align 64, !dbg !0
27
28 ; Function Attrs: noinline
29 define float @dummy_() #0 {
30 .L.entry:
31 ret float undef
32 }
33
34 attributes #0 = { noinline "target-cpu"="x86-64" "target-features"="+cx8,+fxsr,+mmx,+sse,+sse2,+x87" }
35
36 !llvm.module.flags = !{!8, !9}
37 !llvm.dbg.cu = !{!3}
38
39 !0 = !DIGlobalVariableExpression(var: !1, expr: !DIExpression())
40 !1 = distinct !DIGlobalVariable(name: "foo", scope: !2, file: !4, type: !7, isLocal: false, isDefinition: true)
41 !2 = !DIModule(scope: !3, name: "dummy", file: !4, line: 2)
42 !3 = distinct !DICompileUnit(language: DW_LANG_Fortran90, file: !4, producer: " F90 Flang - 1.5 2017-05-01", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, enums: !5, retainedTypes: !5, globals: !6, imports: !5)
43 !4 = !DIFile(filename: "module.f90", directory: "/fortran")
44 !5 = !{}
45 !6 = !{!0}
46 !7 = !DIBasicType(name: "integer", size: 32, align: 32, encoding: DW_ATE_signed)
47 !8 = !{i32 2, !"Dwarf Version", i32 4}
48 !9 = !{i32 2, !"Debug Info Version", i32 3}