Debian Codegraph @

gcc/testsuite/gfortran.dg/coarray_41.f90

raw
1 ! { dg-do run }
2 ! { dg-options "-fcoarray=lib -lcaf_single" }
3 ! { dg-additional-options "-latomic" { target libatomic_available } }
4
5 program coarray_41
6
7 integer, allocatable :: vec(:)[:,:]
8
9 allocate(vec(10)[2,*], source= 37)
10
11 if (.not. allocated(vec)) error stop
12
13 call foo(vec)
14
15 if (any(vec /= 42)) error stop
16
17 deallocate(vec)
18 contains
19
20 subroutine foo(gv)
21
22 integer, allocatable, intent(inout) :: gv(:)[:,:]
23 integer, allocatable :: gvin(:)
24
25 allocate(gvin, mold=gv)
26 gvin = 5
27 gv = gv + gvin
28 end subroutine foo
29
30 end program coarray_41