1 // RUN: fir-opt --add-debug-info --mlir-print-debuginfo %s | FileCheck %s
4 module attributes {dlti.dl_spec = #dlti.dl_spec<>} {
5 fir.global @_QMhelperEgli : i32 {
9 fir.global @_QMhelperEglr : f32 {
10 %0 = fir.zero_bits f32
11 fir.has_value %0 : f32
13 func.func @_QMhelperPtest() {
14 %c67_i32 = arith.constant 67 : i32
15 %cst = arith.constant 1.234000e+01 : f32
16 %0 = fir.address_of(@_QMhelperEgli) : !fir.ref<i32>
17 %1 = fir.address_of(@_QMhelperEglr) : !fir.ref<f32>
18 fir.store %cst to %1 : !fir.ref<f32>
19 fir.store %c67_i32 to %0 : !fir.ref<i32>
23 #loc1 = loc("test.f90":12:11)
24 #loc2 = loc("test.f90":15:8)
25 #loc3 = loc("test.f90":20:5)
27 // CHECK-DAG: #[[I4:.*]] = #llvm.di_basic_type<tag = DW_TAG_base_type, name = "integer", sizeInBits = 32, encoding = DW_ATE_signed>
28 // CHECK-DAG: #[[R4:.*]] = #llvm.di_basic_type<tag = DW_TAG_base_type, name = "real", sizeInBits = 32, encoding = DW_ATE_float>
29 // CHECK-DAG: #[[CU:.*]] = #llvm.di_compile_unit<{{.*}}>
30 // CHECK-DAG: #[[MOD:.*]] = #llvm.di_module<{{.*}}scope = #[[CU]], name = "helper"{{.*}}>
31 // CHECK-DAG: #[[LOC1:.*]] = loc("{{.*}}test.f90":12{{.*}})
32 // CHECK-DAG: #[[GLI:.*]] = #llvm.di_global_variable<scope = #[[MOD]], name = "gli", linkageName = "_QMhelperEgli"{{.*}}line = 12, type = #[[I4]], isDefined = true>
33 // CHECK-DAG: #[[LOC2:.*]] = loc("{{.*}}test.f90":15{{.*}})
34 // CHECK-DAG: #[[GLR:.*]] = #llvm.di_global_variable<scope = #[[MOD]], name = "glr", linkageName = "_QMhelperEglr"{{.*}}line = 15, type = #[[R4]], isDefined = true>
35 // CHECK-DAG: #[[LOC3:.*]] = loc("{{.*}}test.f90":20{{.*}})
36 // CHECK-DAG: #[[TEST:.*]] = #llvm.di_subprogram<{{.*}}compileUnit = #[[CU]], scope = #[[MOD]], name = "test", linkageName = "_QMhelperPtest"{{.*}}line = 20, scopeLine = 20{{.*}}>
37 // CHECK-DAG: loc(fused<#[[GLI]]>[#[[LOC1]]])
38 // CHECK-DAG: loc(fused<#[[GLR]]>[#[[LOC2]]])
39 // CHECK-DAG: loc(fused<#[[TEST]]>[#[[LOC3]]])