38272f45fe
To make it easier for lowering to identify which symbols from the host are captured by internal subprograms, create HostAssocDetails for them. In particular, if a symbol is referenced and it is contained in a subprogram or main program that is not the same as the containing program unit of the reference, a HostAssocDetails symbol is created in the current scope. Differential Revision: https://reviews.llvm.org/D84889
25 lines
591 B
Fortran
25 lines
591 B
Fortran
! RUN: %S/test_symbols.sh %s %t %f18
|
|
! Test host association in internal subroutine of main program.
|
|
|
|
!DEF: /main MainProgram
|
|
program main
|
|
!DEF: /main/x ObjectEntity INTEGER(4)
|
|
integer x
|
|
!DEF: /main/s (Subroutine) Subprogram
|
|
call s
|
|
contains
|
|
!REF: /main/s
|
|
subroutine s
|
|
!DEF: /main/s/y (Implicit) ObjectEntity REAL(4)
|
|
!DEF: /main/s/x HostAssoc INTEGER(4)
|
|
y = x
|
|
contains
|
|
!DEF: /main/s/s2 (Subroutine) Subprogram
|
|
subroutine s2
|
|
!DEF: /main/s/s2/z (Implicit) ObjectEntity REAL(4)
|
|
!DEF: /main/s/s2/x HostAssoc INTEGER(4)
|
|
z = x
|
|
end subroutine
|
|
end subroutine
|
|
end program
|