summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gfortran.dg/coarray_allocate_11.f90
blob: 0e4f64e1e3d41f437c7c361f8d787c0c1b8f60cc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
! { dg-do compile }
! { dg-additional-options -fcoarray=single }
program p
   integer, allocatable :: z[:,:]
   integer :: i
   allocate (z[1:,*]) ! { dg-error "Bad coarray specification in ALLOCATE statement" }
   allocate (z[:2,*]) ! { dg-error "Bad coarray specification in ALLOCATE statement" }
   allocate (z[2:1,*]) ! { dg-error "Upper cobound is less than lower cobound" }
   allocate (z[:0,*]) ! { dg-error "Bad coarray specification in ALLOCATE statement" }
   allocate (z[0,*]) ! { dg-error "Upper cobound is less than lower cobound" }
   allocate (z[1,*]) ! This is OK
   allocate (z[1:1,*]) ! This is OK
   allocate (z[i:i,*]) ! This is OK
   allocate (z[i:i-1,*]) ! { dg-error "Upper cobound is less than lower cobound" }
end