2020-05-12 02:38:53 +08:00
|
|
|
! RUN: %S/test_modfile.sh %s %t %f18
|
2018-11-07 09:18:06 +08:00
|
|
|
module m
|
|
|
|
integer(8), parameter :: a = 1, b = 2_8
|
2018-12-06 22:59:37 +08:00
|
|
|
parameter(n=3,l=-3,e=1.0/3.0)
|
2018-11-07 09:18:06 +08:00
|
|
|
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
|
2018-12-06 22:59:37 +08:00
|
|
|
type(t(a+3,:)), allocatable :: z
|
2018-12-12 06:51:08 +08:00
|
|
|
class(t(a+4,:)), allocatable :: z2
|
|
|
|
class(*), allocatable :: z4
|
2018-12-06 22:59:37 +08:00
|
|
|
real*2 :: f
|
|
|
|
complex*32 :: g
|
2018-12-07 09:52:43 +08:00
|
|
|
type t2(i, j, h)
|
|
|
|
integer, len :: h
|
|
|
|
integer, kind :: j
|
|
|
|
integer, len :: i
|
|
|
|
end type
|
2018-11-07 09:18:06 +08:00
|
|
|
contains
|
|
|
|
subroutine foo(x)
|
|
|
|
real :: x(2:)
|
|
|
|
end
|
|
|
|
subroutine bar(x)
|
|
|
|
real :: x(..)
|
|
|
|
end
|
[flang] Semantic checks for C709, C710, and C711
C709 An assumed-type entity shall be a dummy data object that does not
have the ALLOCATABLE, CODIMENSION, INTENT (OUT), POINTER, or VALUE
attribute and is not an explicit-shape array.
C710 An assumed-type variable name shall not appear in a designator or
expression except as an actual argument corresponding to a dummy
argument that is assumed-type, or as the first argument to the intrinsic
function IS_CONTIGUOUS, LBOUND, PRESENT, RANK, SHAPE, SIZE, or UBOUND,
or the function C_LOC from the intrinsic module ISO_C_BINDING.
C711 An assumed-type actual argument that corresponds to an assumed-rank
dummy argument shall be assumed-shape or assumed-rank.
For C709 I added code to check-declarations.cpp. For this, I had to
distinguish between polymorphic types and assumed-type types to
eliminate multiple messages on the same line.
C710 was already checked, but I added a notation in the source.
For C711 I added code to check-call.cpp and the test call15.f90.
Original-commit: flang-compiler/f18@4a703f2b5a6484208a059dc0b456363c138a661d
Reviewed-on: https://github.com/flang-compiler/f18/pull/985
2020-02-15 07:53:11 +08:00
|
|
|
subroutine baz(x)
|
|
|
|
type(*) :: x
|
|
|
|
end
|
2018-11-07 09:18:06 +08:00
|
|
|
end
|
|
|
|
|
|
|
|
!Expect: m.mod
|
|
|
|
!module m
|
2019-05-14 00:33:18 +08:00
|
|
|
! integer(8),parameter::a=1_8
|
2018-11-07 09:18:06 +08:00
|
|
|
! integer(8),parameter::b=2_8
|
|
|
|
! integer(4),parameter::n=3_4
|
2018-12-06 22:59:37 +08:00
|
|
|
! integer(4),parameter::l=-3_4
|
|
|
|
! real(4),parameter::e=3.333333432674407958984375e-1_4
|
2019-01-08 08:31:59 +08:00
|
|
|
! real(4)::x(1_8:13_8)
|
|
|
|
! real(4)::y(1_8:8_8)
|
2018-11-07 09:18:06 +08:00
|
|
|
! type::t(c,d)
|
|
|
|
! integer(4),kind::c=1_4
|
2019-05-14 00:33:18 +08:00
|
|
|
! integer(4),len::d=3_4
|
2018-11-07 09:18:06 +08:00
|
|
|
! end type
|
2018-12-05 02:55:32 +08:00
|
|
|
! type(t(c=4_4,d=:)),allocatable::z
|
|
|
|
! class(t(c=5_4,d=:)),allocatable::z2
|
2018-12-12 06:51:08 +08:00
|
|
|
! class(*),allocatable::z4
|
2018-12-06 22:59:37 +08:00
|
|
|
! real(2)::f
|
|
|
|
! complex(16)::g
|
2018-12-07 09:52:43 +08:00
|
|
|
! type::t2(i,j,h)
|
|
|
|
! integer(4),len::h
|
|
|
|
! integer(4),kind::j
|
|
|
|
! integer(4),len::i
|
|
|
|
! end type
|
2018-11-07 09:18:06 +08:00
|
|
|
!contains
|
|
|
|
! subroutine foo(x)
|
2019-01-08 08:31:59 +08:00
|
|
|
! real(4)::x(2_8:)
|
2018-11-07 09:18:06 +08:00
|
|
|
! end
|
|
|
|
! subroutine bar(x)
|
|
|
|
! real(4)::x(..)
|
|
|
|
! end
|
[flang] Semantic checks for C709, C710, and C711
C709 An assumed-type entity shall be a dummy data object that does not
have the ALLOCATABLE, CODIMENSION, INTENT (OUT), POINTER, or VALUE
attribute and is not an explicit-shape array.
C710 An assumed-type variable name shall not appear in a designator or
expression except as an actual argument corresponding to a dummy
argument that is assumed-type, or as the first argument to the intrinsic
function IS_CONTIGUOUS, LBOUND, PRESENT, RANK, SHAPE, SIZE, or UBOUND,
or the function C_LOC from the intrinsic module ISO_C_BINDING.
C711 An assumed-type actual argument that corresponds to an assumed-rank
dummy argument shall be assumed-shape or assumed-rank.
For C709 I added code to check-declarations.cpp. For this, I had to
distinguish between polymorphic types and assumed-type types to
eliminate multiple messages on the same line.
C710 was already checked, but I added a notation in the source.
For C711 I added code to check-call.cpp and the test call15.f90.
Original-commit: flang-compiler/f18@4a703f2b5a6484208a059dc0b456363c138a661d
Reviewed-on: https://github.com/flang-compiler/f18/pull/985
2020-02-15 07:53:11 +08:00
|
|
|
! subroutine baz(x)
|
|
|
|
! type(*)::x
|
|
|
|
! end
|
2018-11-07 09:18:06 +08:00
|
|
|
!end
|