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