mirror of
https://github.com/llvm/llvm-project.git
synced 2025-04-17 15:36:49 +00:00

Detect and report a bunch of uncaught semantic errors with coarray declarations. Add more tests, and clean up bad usage in existing tests.
32 lines
699 B
Fortran
32 lines
699 B
Fortran
! RUN: %python %S/test_errors.py %s %flang_fc1
|
|
! Test coarray association in CHANGE TEAM statement
|
|
|
|
subroutine s1
|
|
use iso_fortran_env
|
|
save
|
|
type(team_type) :: t
|
|
complex :: x[*]
|
|
real :: y[*]
|
|
real :: z
|
|
! OK
|
|
change team(t, x[*] => y)
|
|
end team
|
|
! C1116
|
|
!ERROR: Selector in coarray association must name a coarray
|
|
change team(t, x[*] => 1)
|
|
end team
|
|
!ERROR: Selector in coarray association must name a coarray
|
|
change team(t, x[*] => z)
|
|
end team
|
|
end
|
|
|
|
subroutine s2
|
|
use iso_fortran_env
|
|
type(team_type) :: t
|
|
real, save :: y[10,*], y2[*], x[*]
|
|
! C1113
|
|
!ERROR: The codimensions of 'x' have already been declared
|
|
change team(t, x[10,*] => y, x[*] => y2)
|
|
end team
|
|
end
|