There were several different ways of handling the option to f18 to find predefined modules: - test_errors.sh was created by cmake substituting FLANG_INTRINSIC_MODULES_DIR into test_errors.sh.in - some tests used the flang script which has the option built it - some tests used %f18_with_includes which was replaced by the path to f18 plus the -I option - some included -I../../include/flang in their run command To make this more consistent, change %f18 to include the -intrinsic-module-directory option and use it everywhere, including to replace %flang and %f18_with_includes. This requires changing all of the invocations of the test scripts to put %f18 at the end so that it can expand to more than one argument. This eliminates the need to generate test_errors.sh which means we don't need flang/test/Semantics/CMakeLists.txt or the %B substitution. That makes the test_errors.sh command like the others, replacing %B/test/Semantics/test_errors.sh with %S/test_errors.sh. Also remove the OPTIONS: functionality as custom options can be included in the RUN: command. And remove -I/../../include/flang as that is now always included. Differential Revision: https://reviews.llvm.org/D79634
40 lines
1.1 KiB
Fortran
40 lines
1.1 KiB
Fortran
! RUN: %S/test_modfile.sh %s %t %f18
|
|
! Test modfiles for entities with initialization
|
|
module m
|
|
integer, parameter :: k8 = 8
|
|
integer(8), parameter :: k4 = k8/2
|
|
integer, parameter :: k1 = 1
|
|
integer(k8), parameter :: i = 2_k8
|
|
real :: r = 2.0_k4
|
|
character(10, kind=k1) :: c = k1_"asdf"
|
|
character(10), parameter :: c2 = k1_"qwer"
|
|
complex*16, parameter :: z = (1.0_k8, 2.0_k8)
|
|
complex*16, parameter :: zn = (-1.0_k8, 2.0_k8)
|
|
type t
|
|
integer :: a = 123
|
|
type(t), pointer :: b => null()
|
|
end type
|
|
type(t), parameter :: x = t(456)
|
|
type(t), parameter :: y = t(789, null())
|
|
end
|
|
|
|
!Expect: m.mod
|
|
!module m
|
|
! integer(4),parameter::k8=8_4
|
|
! integer(8),parameter::k4=4_8
|
|
! integer(4),parameter::k1=1_4
|
|
! integer(8),parameter::i=2_8
|
|
! real(4)::r
|
|
! character(10_4,1)::c
|
|
! character(10_4,1),parameter::c2="qwer "
|
|
! complex(8),parameter::z=(1._8,2._8)
|
|
! complex(8),parameter::zn=(-1._8,2._8)
|
|
! type::t
|
|
! integer(4)::a=123_4
|
|
! type(t),pointer::b=>NULL()
|
|
! end type
|
|
! type(t),parameter::x=t(a=456_4,b=NULL())
|
|
! type(t),parameter::y=t(a=789_4,b=NULL())
|
|
! intrinsic::null
|
|
!end
|