brintos

brintos / llvm-project-archived public Read only

0
0
Text · 990 B · f1c4780 Raw
30 lines · plain
1! Test instantiation of module variables inside an internal subprogram2! where the use statement is inside the host program.3! RUN: bbc -emit-hlfir -o - %s | FileCheck %s4 5module module_used_by_host6 implicit none7 integer :: indexed_by_var(2)8 integer :: ref_in_implied_do9 integer :: ref_in_forall(2)10end module11 12subroutine host_procedure13 use module_used_by_host14 implicit none15contains16 subroutine internal_procedure(i, mask)17  integer :: i18  logical :: mask(2)19  indexed_by_var(i) = 020  print *, (/(ref_in_implied_do, integer::j=1,10)/)21  forall (integer::k = 1:2)22    ref_in_forall(k) = 023  end forall24 end subroutine25end subroutine26! CHECK-LABEL: func.func private @_QFhost_procedurePinternal_procedure(27! CHECK:    fir.address_of(@_QMmodule_used_by_hostEindexed_by_var) : !fir.ref<!fir.array<2xi32>>28! CHECK:    fir.address_of(@_QMmodule_used_by_hostEref_in_forall) : !fir.ref<!fir.array<2xi32>>29! CHECK:    fir.address_of(@_QMmodule_used_by_hostEref_in_implied_do) : !fir.ref<i32>30