summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gfortran.dg/coarray_allocate_12.f90
blob: 2169aa199988bdda3f8e60c2f0191a9d28b87c96 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
! { 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