blob: 0e806f0955b3ce27cb77bbe9551ca1c6bf161cfe (
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 array specification in ALLOCATE statement" }
allocate (z[:2,*]) ! { dg-error "Bad array specification in ALLOCATE statement" }
allocate (z[2:1,*]) ! { dg-error "Upper cobound is less than lower cobound" }
allocate (z[:0,*]) ! { dg-error "Bad array 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
|