36 lines · plain
1! RUN: %python %S/test_errors.py %s %flang_fc12! Test ASSIGN statement, assigned GOTO, and assigned format labels3! (see subclause 8.2.4 in Fortran 90 (*not* 2018!)4 5program main6 call test(0)72 format('no')8 contains9 subroutine test(n)10 !ERROR: Label '4' is not a branch target or FORMAT114 integer, intent(in) :: n12 integer :: lab13 assign 1 to lab ! ok14 assign 1 to implicitlab1 ! ok15 !ERROR: Label '666' was not found16 assign 666 to lab17 !ERROR: Label '2' was not found18 assign 2 to lab19 assign 4 to lab20 if (n==1) goto lab ! ok21 if (n==1) goto implicitlab2 ! ok22 if (n==1) goto lab(1) ! ok23 if (n==1) goto lab,(1) ! ok24 if (n==1) goto lab(1,1) ! ok25 !ERROR: Label '666' was not found26 if (n==1) goto lab(1,666)27 !ERROR: Label '2' was not found28 if (n==1) goto lab(1,2)29 assign 3 to lab30 write(*,fmt=lab) ! ok31 write(*,fmt=implicitlab3) ! ok321 continue333 format('yes')34 end subroutine test35end program36