Files
clang-p2996/flang/test/Semantics/modfile53.f90
Peter Klausler 2e4499e749 [flang] Handle forward references to modules
When a USE of a module precedes its definition in the same source
file, ensure that the module is processed by name resolution before
the USE statement.  This prevents the risk of the USE statement using
an obsolete module file that is later overwritten during the same
compilation.

Differential Revision: https://reviews.llvm.org/D143799
2023-02-12 18:41:35 -08:00

29 lines
342 B
Fortran

! RUN: %python %S/test_modfile.py %s %flang_fc1
! Ensure that a module can be forward-referenced within a compilation unit.
module m1
use m2
end
module m2
use m3
end
module m3
integer n
end
!Expect: m1.mod
!module m1
!use m2,only:n
!end
!Expect: m2.mod
!module m2
!use m3,only:n
!end
!Expect: m3.mod
!module m3
!integer(4)::n
!end