[LLVM] Fix Maintainers.md formatting (NFC)
[llvm-project.git] / flang / test / Semantics / assign07.f90
blob41a99c1d5d0a7d7a876b3c8f4b51991cb3b011ff
1 ! RUN: %python %S/test_errors.py %s %flang_fc1
2 ! Test ASSIGN statement, assigned GOTO, and assigned format labels
3 ! (see subclause 8.2.4 in Fortran 90 (*not* 2018!)
5 program main
6 call test(0)
7 2 format('no')
8 contains
9 subroutine test(n)
10 !ERROR: Label '4' is not a branch target or FORMAT
11 4 integer, intent(in) :: n
12 integer :: lab
13 assign 1 to lab ! ok
14 assign 1 to implicitlab1 ! ok
15 !ERROR: Label '666' was not found
16 assign 666 to lab
17 !ERROR: Label '2' was not found
18 assign 2 to lab
19 assign 4 to lab
20 if (n==1) goto lab ! ok
21 if (n==1) goto implicitlab2 ! ok
22 if (n==1) goto lab(1) ! ok
23 if (n==1) goto lab,(1) ! ok
24 if (n==1) goto lab(1,1) ! ok
25 !ERROR: Label '666' was not found
26 if (n==1) goto lab(1,666)
27 !ERROR: Label '2' was not found
28 if (n==1) goto lab(1,2)
29 assign 3 to lab
30 write(*,fmt=lab) ! ok
31 write(*,fmt=implicitlab3) ! ok
32 1 continue
33 3 format('yes')
34 end subroutine test
35 end program