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 @_QMfooEv1 : i32 {
9 fir.global internal @_QFtestExyz : i32 {
10 %c12_i32 = arith.constant 12 : i32
11 fir.has_value %c12_i32 : i32
13 func.func @test() attributes {fir.bindc_name = "test"} {
14 %0 = fir.address_of(@_QMfooEv1) : !fir.ref<i32>
15 %1 = fircg.ext_declare %0 {uniq_name = "_QMfooEv1"} : (!fir.ref<i32>) -> !fir.ref<i32> loc(#loc1)
16 %4 = fir.address_of(@_QFtestExyz) : !fir.ref<i32>
17 %5 = fircg.ext_declare %4 {uniq_name = "_QFtestExyz"} : (!fir.ref<i32>) -> !fir.ref<i32> loc(#loc4)
21 #loc1 = loc("test.f90":2:14)
22 #loc2 = loc("test.f90":6:1)
23 #loc3 = loc("test.f90":10:1)
24 #loc4 = loc("test.f90":13:1)
26 // CHECK: #[[MOD:.+]] = #llvm.di_module<{{.*}}name = "foo"{{.*}}>
27 // CHECK: #[[SP_REC:.+]] = #llvm.di_subprogram<recId = distinct[[[REC_ID:[0-9]+]]]<>, isRecSelf = true{{.*}}>
28 // CHECK: #[[IMP_ENTITY:.+]] = #llvm.di_imported_entity<tag = DW_TAG_imported_module, scope = #[[SP_REC]], entity = #[[MOD]]{{.*}}>
29 // CHECK: #[[SP:.+]] = #llvm.di_subprogram<recId = distinct[[[REC_ID]]]<>{{.*}}retainedNodes = #[[IMP_ENTITY]]>
30 // CHECK: #llvm.di_global_variable<scope = #[[SP]], name = "xyz"{{.*}}>