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!)
9 integer, intent(in
) :: n
11 integer(kind
=1) :: badlab1
14 character, pointer :: badlab4(:) ! not contiguous
15 character, pointer, contiguous
:: oklab4(:)
17 assign 1 to implicitlab1
! ok
18 !ERROR: 'badlab1' must be a default integer scalar variable
20 !ERROR: 'badlab2' must be a default integer scalar variable
22 !ERROR: 'badlab3' must be a default integer scalar variable
24 !ERROR: 'test' must be a default integer scalar variable
26 if (n
==1) goto lab
! ok
27 if (n
==1) goto implicitlab2
! ok
28 !ERROR: 'badlab1' must be a default integer scalar variable
29 if (n
==1) goto badlab1
30 !ERROR: 'badlab2' must be a default integer scalar variable
31 if (n
==1) goto badlab2
32 !ERROR: 'badlab3' must be a default integer scalar variable
33 if (n
==1) goto badlab3
34 if (n
==1) goto lab(1) ! ok
35 if (n
==1) goto lab
,(1) ! ok
36 if (n
==1) goto lab(1,1) ! ok
39 write(*,fmt
=implicitlab3
) ! ok
40 !ERROR: Format expression must be default character or default scalar integer
42 !ERROR: Format expression must be default character or default scalar integer
43 write(*,fmt
=z
'feedface')
44 !Legacy extension cases
48 write(*,fmt
=badlab4
) ! ok
49 write(*,fmt
=badlab5
) ! ok