106 lines · plain
1! RUN: %python %S/test_errors.py %s %flang_fc12subroutine s13 namelist /nl/x4 block5 !ERROR: NAMELIST statement is not allowed in a BLOCK construct6 namelist /nl/y7 end block8end9 10subroutine s211 open(12, file='nl.out')12 !ERROR: Namelist group 'nl' not found13 write(12, nml=nl)14end15 16subroutine s317 real :: x18 open(12, file='nl.out')19 !ERROR: 'x' is not the name of a namelist group20 write(12, nml=x)21end22 23module m424 real :: x25 namelist /nl/x26end27subroutine s4a28 use m429 namelist /nl2/x30 open(12, file='nl.out')31 write(12, nml=nl)32 write(12, nml=nl2)33end34subroutine s4b35 use m436 real :: y37 !ERROR: 'nl' is already declared in this scoping unit38 namelist /nl/y39end40 41subroutine s542 namelist /nl/x43 integer x44end45 46subroutine s647 !ERROR: 's6' is not a variable48 namelist /nl/ s649 !ERROR: 'f' is not a variable50 namelist /nl/ f51contains52 integer function f()53 f = 154 end55end56 57subroutine s758 real x59 !ERROR: 'x' is not a variable60 namelist /nl/ x61 external x62end63 64subroutine s865 data x/1.0/66 !ERROR: The type of 'x' has already been implicitly declared67 integer x68end69 70subroutine s971 real :: x(2,2)72 ! Nested implied DO loops have their own scope73 data ((x(i,j),j=1,2),(x(i,j),j=1,2),i=1,2)/8*0.0/74end75 76module m1077 integer :: x78 public :: nl79 namelist /nl/ x80end81 82subroutine s1183 integer :: nl284 !ERROR: 'nl2' is already declared in this scoping unit85 namelist /nl2/x86 namelist /nl3/x87 !ERROR: 'nl3' is already declared in this scoping unit88 integer :: nl389 nl2 = 190end91 92subroutine s12(x)93 real, intent(in) :: x94 namelist /nl/x95 !ERROR: NAMELIST input group must not contain undefinable item 'x'96 !BECAUSE: 'x' is an INTENT(IN) dummy argument97 read(*,nml=nl)98end99 100subroutine s13()101 implicit none102 !ERROR: No explicit type declared for 'i'103 !ERROR: No explicit type declared for 'i'104 print *, (i, i = 1, 2)105end106