aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gfortran.dg/coarray/pr107441-caf.f90
blob: 23b2242e217e466ce4d35ea46da5c6a7de329c66 (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
! { dg-do run }
!
! PR fortran/107441
! Check that with -fcoarray=lib, coarray metadata arguments are passed
! in the right order to procedures.
!
! Contributed by M.Morin

program p
  integer :: ci[*]
  ci = 17
  call s(1, ci, "abcd")
contains
  subroutine s(ra, ca, c)
    integer :: ra, ca[*]
    character(*) :: c
    ca[1] = 13
    if (ra /= 1) stop 1
    if (this_image() == 1) then
      if (ca /= 13) stop 2
    else
      if (ca /= 17) stop 3
    end if
    if (len(c) /= 4) stop 4
    if (c /= "abcd") stop 5
  end subroutine s
end program p