63 lines · plain
1! RUN: %python %S/test_errors.py %s %flang_fc12 3! Test use of implicitly declared variable in specification expression4 5subroutine s1()6 m = 17contains8 subroutine s1a()9 implicit none10 !ERROR: No explicit type declared for 'n'11 real :: a(m, n)12 end13 subroutine s1b()14 !ERROR: Implicitly typed local entity 'n' not allowed in specification expression15 real :: a(m, n)16 end17end18 19subroutine s2()20 type :: t(m, n)21 integer, len :: m22 integer, len :: n23 end type24 n = 125contains26 subroutine s2a()27 !ERROR: Implicitly typed local entity 'm' not allowed in specification expression28 type(t(m, n)) :: a29 end30 subroutine s2b()31 implicit none32 !ERROR: No explicit type declared for 'm'33 character(m) :: a34 end35end36 37subroutine s3()38 m = 139contains40 subroutine s3a()41 implicit none42 real :: a(m, n)43 !WARN: '%s' was used without (or before) being explicitly typed44 !ERROR: No explicit type declared for 'n'45 common n46 end47 subroutine s3b()48 ! n is okay here because it is in a common block49 real :: a(m, n)50 common n51 end52end53 54subroutine s4()55 implicit none56contains57 subroutine s4a()58 !ERROR: No explicit type declared for 'n'59 real :: a(n)60 end61end62 63