78 lines · plain
1! RUN: %python %S/test_errors.py %s %flang_fc12! Test selector and team-value in CHANGE TEAM statement3 4! OK5subroutine s1(y)6 use iso_fortran_env, only: team_type7 type(team_type) :: t8 real :: y[10,*]9 change team(t, x[10,*] => y)10 end team11 form team(1, t)12end13 14subroutine s2(y,y2,x)15 use iso_fortran_env16 type(team_type) :: t17 real :: y[10,*], y2[*], x[*]18 ! C111319 !ERROR: Selector 'y' was already used as a selector or coarray in this statement20 change team(t, x[10,*] => y, x2[*] => y)21 end team22 !ERROR: Selector 'x' was already used as a selector or coarray in this statement23 change team(t, x[10,*] => y, x2[*] => x)24 end team25 !ERROR: Coarray 'y' was already used as a selector or coarray in this statement26 change team(t, x[10,*] => y, y[*] => y2)27 end team28end29 30subroutine s3(y)31 type :: team_type32 end type33 type :: foo34 real :: a35 end type36 type(team_type) :: t137 type(foo) :: t238 type(team_type) :: t3(3)39 real :: y[10,*]40 ! C111441 !ERROR: Team value must be of type TEAM_TYPE from module ISO_FORTRAN_ENV42 change team(t1, x[10,*] => y)43 end team44 !ERROR: Team value must be of type TEAM_TYPE from module ISO_FORTRAN_ENV45 change team(t2, x[10,*] => y)46 end team47 !ERROR: Team value must be of type TEAM_TYPE from module ISO_FORTRAN_ENV48 change team(t2%a, x[10,*] => y)49 end team50 !ERROR: Must be a scalar value, but is a rank-1 array51 change team(t3, x[10,*] => y)52 end team53 !ERROR: Team value must be of type TEAM_TYPE from module ISO_FORTRAN_ENV54 form team(1, t1)55 !ERROR: Team value must be of type TEAM_TYPE from module ISO_FORTRAN_ENV56 form team(2, t2)57 !ERROR: Team value must be of type TEAM_TYPE from module ISO_FORTRAN_ENV58 form team(2, t2%a)59 !ERROR: Team value must be of type TEAM_TYPE from module ISO_FORTRAN_ENV60 form team(3, t3(2))61 !ERROR: Must be a scalar value, but is a rank-1 array62 form team(3, t3)63end64 65subroutine s466 use iso_fortran_env, only: team_type67 complex :: z68 integer :: i, j(10)69 type(team_type) :: t, t2(2)70 form team(i, t)71 !ERROR: Must be a scalar value, but is a rank-1 array72 form team(1, t2)73 !ERROR: Must have INTEGER type, but is COMPLEX(4)74 form team(z, t)75 !ERROR: Must be a scalar value, but is a rank-1 array76 form team(j, t)77end78