mirror of
https://github.com/llvm/llvm-project.git
synced 2025-04-17 03:26:48 +00:00

Apply the default PUBLIC/PRIVATE accessibility of a module to its symbols a second time after it is known that all symbols, including implicitly typed names from NAMELIST groups and specification expressions in module subprograms, have been created in its scope. Fixes https://github.com/llvm/llvm-project/issues/62598. Differential Revision: https://reviews.llvm.org/D150307
24 lines
667 B
Fortran
24 lines
667 B
Fortran
! RUN: %python %S/test_symbols.py %s %flang_fc1
|
|
! Regression test for https://github.com/llvm/llvm-project/issues/62598
|
|
! Ensure that implicitly typed names in module NAMELIST groups receive
|
|
! the module's default accessibility attribute.
|
|
!DEF: /m Module
|
|
module m
|
|
!DEF: /m/a PUBLIC Namelist
|
|
!DEF: /m/j PUBLIC (Implicit, InNamelist) ObjectEntity INTEGER(4)
|
|
namelist/a/j
|
|
end module m
|
|
!DEF: /main MainProgram
|
|
program main
|
|
!DEF: /main/j (Implicit) ObjectEntity INTEGER(4)
|
|
j = 1
|
|
contains
|
|
!DEF: /main/inner (Subroutine) Subprogram
|
|
subroutine inner
|
|
!REF: /m
|
|
use :: m
|
|
!DEF: /main/inner/j (Implicit, InNamelist) Use INTEGER(4)
|
|
j = 2
|
|
end subroutine
|
|
end program
|