blob: 2169aa199988bdda3f8e60c2f0191a9d28b87c96 [file] [log] [blame]
! { dg-do compile }
! { dg-options "-fcoarray=single" }
!
! PR fortran/105184
! Based on testcases by Gerhard Steinmetz
program p
real, allocatable :: x[:,:]
integer :: n = 2
allocate (x[ n, *])
allocate (x[1:n, *])
allocate (x[n:n, *])
allocate (x[n, 5:*])
allocate (x[ :n, *]) ! { dg-error "Bad coarray specification" }
allocate (x[::n, *]) ! { dg-error "Bad coarray specification" }
allocate (x[ :1:1, *]) ! { dg-error "Bad coarray specification" }
allocate (x[1:n:n, *]) ! { dg-error "Bad coarray specification" }
allocate (x[1, : *]) ! { dg-error "Missing lower bound" }
end