aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gfortran.dg/coarray/coindexed_3.f08
blob: 29c2b3a8028705af8dedf71b6df5799d55122dc8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
!{ dg-do run }

! Check that team_number is supported in coindices.
! Adapted from code sent by Thomas Koenig  <tkoenig@gcc.gnu.org>

program pr98903
  use, intrinsic :: iso_fortran_env
  integer :: me, n, s
  integer :: a[*]
  type(team_type) :: team

  me = this_image()
  n = num_images()
  a = 42
  s = 42

  ! Checking against single image only.  Therefore team statements are
  ! not viable nor are they (yet) supported by GFortran.
  if (a[1, team_number=-1, stat=s] /= 42) stop 1
  if (s /= 0) stop 2

  s = 42
  if (a[1, team = team, stat=s] /= 42) stop 3
  if (s /= 0) stop 4

  s = 42
  if (a[1, stat=s] /= 42) stop 5
  if (s /= 0) stop 6
end program pr98903