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
67 lines
1.3 KiB
Fortran
67 lines
1.3 KiB
Fortran
! RUN: %S/test_modfile.sh %s %t %f18
|
|
module m
|
|
integer(8), parameter :: a = 1, b = 2_8
|
|
parameter(n=3,l=-3,e=1.0/3.0)
|
|
real :: x(a:2*(a+b*n)-1)
|
|
real, dimension(8) :: y
|
|
type t(c, d)
|
|
integer, kind :: c = 1
|
|
integer, len :: d = a + b
|
|
end type
|
|
type(t(a+3,:)), allocatable :: z
|
|
class(t(a+4,:)), allocatable :: z2
|
|
class(*), allocatable :: z4
|
|
real*2 :: f
|
|
complex*32 :: g
|
|
type t2(i, j, h)
|
|
integer, len :: h
|
|
integer, kind :: j
|
|
integer, len :: i
|
|
end type
|
|
contains
|
|
subroutine foo(x)
|
|
real :: x(2:)
|
|
end
|
|
subroutine bar(x)
|
|
real :: x(..)
|
|
end
|
|
subroutine baz(x)
|
|
type(*) :: x
|
|
end
|
|
end
|
|
|
|
!Expect: m.mod
|
|
!module m
|
|
! integer(8),parameter::a=1_8
|
|
! integer(8),parameter::b=2_8
|
|
! integer(4),parameter::n=3_4
|
|
! integer(4),parameter::l=-3_4
|
|
! real(4),parameter::e=3.333333432674407958984375e-1_4
|
|
! real(4)::x(1_8:13_8)
|
|
! real(4)::y(1_8:8_8)
|
|
! type::t(c,d)
|
|
! integer(4),kind::c=1_4
|
|
! integer(4),len::d=3_4
|
|
! end type
|
|
! type(t(c=4_4,d=:)),allocatable::z
|
|
! class(t(c=5_4,d=:)),allocatable::z2
|
|
! class(*),allocatable::z4
|
|
! real(2)::f
|
|
! complex(16)::g
|
|
! type::t2(i,j,h)
|
|
! integer(4),len::h
|
|
! integer(4),kind::j
|
|
! integer(4),len::i
|
|
! end type
|
|
!contains
|
|
! subroutine foo(x)
|
|
! real(4)::x(2_8:)
|
|
! end
|
|
! subroutine bar(x)
|
|
! real(4)::x(..)
|
|
! end
|
|
! subroutine baz(x)
|
|
! type(*)::x
|
|
! end
|
|
!end
|