c: Fix up pointer types to may_alias structures [PR114493]
[official-gcc.git] / gcc / testsuite / gfortran.dg / coarray_41.f90
blob0a98e5528c86ab3ec2f77a2c2d72ed4a4bd2e016
1 ! { dg-do run }
2 ! { dg-options "-fcoarray=lib -lcaf_single" }
3 ! { dg-additional-options "-latomic" { target libatomic_available } }
5 program coarray_41
7 integer, allocatable :: vec(:)[:,:]
9 allocate(vec(10)[2,*], source= 37)
11 if (.not. allocated(vec)) error stop
13 call foo(vec)
15 if (any(vec /= 42)) error stop
17 deallocate(vec)
18 contains
20 subroutine foo(gv)
22 integer, allocatable, intent(inout) :: gv(:)[:,:]
23 integer, allocatable :: gvin(:)
25 allocate(gvin, mold=gv)
26 gvin = 5
27 gv = gv + gvin
28 end subroutine foo
30 end program coarray_41