2 ! { dg-options "-std=f95" }
6 ! Check that standards-conforming mode rejects uses of variables that
7 ! are used before they are typed.
9 SUBROUTINE test1 (n
, arr
, m
, arr2
, k
, arr3
, a
) ! { dg-error "has no IMPLICIT" }
12 INTEGER :: arr(n
) ! { dg-error "used before it is typed" }
14 INTEGER :: m
, arr2(m
) ! { dg-bogus "used before it is typed" }
15 INTEGER, DIMENSION(k
) :: arr3
! { dg-error "used before it is typed" }
17 CHARACTER(len
=LEN(a
)) :: a
! { dg-error "'a' is used before it is typed" }
19 REAL(KIND
=l
) :: x
! { dg-error "has no IMPLICIT type" }
20 REAL(KIND
=KIND(y
)) :: y
! { dg-error "has no IMPLICIT type" }
22 DATA str
/'abc'/ ! { dg-error "used before it is typed" }
23 CHARACTER(len
=3) :: str
, str2
24 DATA str2
/'abc'/ ! { dg-bogus "used before it is typed" }
27 SUBROUTINE test2 (n
, arr
, m
, arr2
)
31 REAL :: n
! { dg-error "already has basic type" }
32 INTEGER :: m
, arr2(m
) ! { dg-bogus "already has an IMPLICIT type" }
35 SUBROUTINE test3 (n
, arr
, m
, arr2
)
38 INTEGER :: arr(n
) ! { dg-error "must be of INTEGER type" }
39 INTEGER :: m
, arr2(m
) ! { dg-bogus "must be of INTEGER type" }