xref: /llvm-project/flang/test/Semantics/resolve50.f90 (revision 6c1ac141d3c98af9738bc77fcb55602cbff7751f)
1! RUN: %python %S/test_errors.py %s %flang_fc1
2! Test coarray association in CHANGE TEAM statement
3
4subroutine s1
5  use iso_fortran_env
6  type(team_type) :: t
7  complex :: x[*]
8  real :: y[*]
9  real :: z
10  ! OK
11  change team(t, x[*] => y)
12  end team
13  ! C1116
14  !ERROR: Selector in coarray association must name a coarray
15  change team(t, x[*] => 1)
16  end team
17  !ERROR: Selector in coarray association must name a coarray
18  change team(t, x[*] => z)
19  end team
20end
21
22subroutine s2
23  use iso_fortran_env
24  type(team_type) :: t
25  real :: y[10,*], y2[*], x[*]
26  ! C1113
27  !ERROR: The codimensions of 'x' have already been declared
28  change team(t, x[10,*] => y, x[*] => y2)
29  end team
30end
31