2014-07-12 Paul Thomas <pault@gcc.gnu.org>
[official-gcc.git] / gcc / testsuite / gfortran.dg / coarray / move_alloc_1.f90
blob1f320522489cb04f01ce146108dc4b20e5edbae5
1 ! { dg-do run }
3 ! PR fortran/53526
5 ! Check handling of move_alloc with coarrays
7 implicit none
8 integer, allocatable :: u[:], v[:], w(:)[:,:], x(:)[:,:]
10 allocate (u[4:*])
11 call move_alloc (u, v)
12 if (allocated (u)) call abort ()
13 if (lcobound (v, dim=1) /= 4) call abort ()
14 if (ucobound (v, dim=1) /= 3 + num_images()) call abort ()
16 allocate (w(-2:3)[4:5,-1:*])
17 call move_alloc (w, x)
18 if (allocated (w)) call abort ()
19 if (lbound (x, dim=1) /= -2) call abort ()
20 if (ubound (x, dim=1) /= 3) call abort ()
21 if (any (lcobound (x) /= [4, -1])) call abort ()
22 if (any (ucobound (x) /= [5, -2 + (num_images()+1)/2])) call abort ()
24 end