File: debug-imported-entity.fir

package info (click to toggle)
llvm-toolchain-20 1%3A20.1.8-1
  • links: PTS, VCS
  • area: main
  • in suites: experimental
  • size: 2,111,696 kB
  • sloc: cpp: 7,438,781; ansic: 1,393,871; asm: 1,012,926; python: 241,771; f90: 86,635; objc: 75,411; lisp: 42,144; pascal: 17,286; sh: 8,596; ml: 5,082; perl: 4,730; makefile: 3,591; awk: 3,523; javascript: 2,251; xml: 892; fortran: 672
file content (30 lines) | stat: -rw-r--r-- 1,356 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
// RUN: fir-opt --add-debug-info --mlir-print-debuginfo %s | FileCheck %s


module attributes {dlti.dl_spec = #dlti.dl_spec<>} {
  fir.global @_QMfooEv1 : i32 {
    %0 = fir.zero_bits i32
    fir.has_value %0 : i32
  }
  fir.global internal @_QFtestExyz : i32 {
    %c12_i32 = arith.constant 12 : i32
    fir.has_value %c12_i32 : i32
  } loc(#loc4)
  func.func @test() attributes {fir.bindc_name = "test"} {
    %0 = fir.address_of(@_QMfooEv1) : !fir.ref<i32>
    %1 = fircg.ext_declare %0 {uniq_name = "_QMfooEv1"} : (!fir.ref<i32>) -> !fir.ref<i32> loc(#loc1)
    %4 = fir.address_of(@_QFtestExyz) : !fir.ref<i32>
    %5 = fircg.ext_declare %4 {uniq_name = "_QFtestExyz"} : (!fir.ref<i32>) -> !fir.ref<i32> loc(#loc4)
    return
  } loc(#loc3)
}
#loc1 = loc("test.f90":2:14)
#loc2 = loc("test.f90":6:1)
#loc3 = loc("test.f90":10:1)
#loc4 = loc("test.f90":13:1)

// CHECK: #[[MOD:.+]] = #llvm.di_module<{{.*}}name = "foo"{{.*}}>
// CHECK: #[[SP_REC:.+]] = #llvm.di_subprogram<recId = distinct[[[REC_ID:[0-9]+]]]<>, isRecSelf = true{{.*}}>
// CHECK: #[[IMP_ENTITY:.+]] = #llvm.di_imported_entity<tag = DW_TAG_imported_module, scope = #[[SP_REC]], entity = #[[MOD]]{{.*}}>
// CHECK: #[[SP:.+]] = #llvm.di_subprogram<recId = distinct[[[REC_ID]]]<>{{.*}}retainedNodes = #[[IMP_ENTITY]]>
// CHECK: #llvm.di_global_variable<scope = #[[SP]], name = "xyz"{{.*}}>