| 1 |
! { dg-do compile } |
| 2 |
program cont_01_neg |
| 3 |
implicit none |
| 4 |
real, pointer, contiguous :: r(:) |
| 5 |
real, pointer, contiguous :: r2(:,:) |
| 6 |
real, target :: x(45) |
| 7 |
real, target :: x2(5,9) |
| 8 |
integer :: i |
| 9 |
integer :: n=1 |
| 10 |
|
| 11 |
x = (/ (real(i),i=1,45) /) |
| 12 |
x2 = reshape(x,shape(x2)) |
| 13 |
r => x(::46) |
| 14 |
r => x(::3) ! { dg-error "Assignment to contiguous pointer from non-contiguous target" } |
| 15 |
r2 => x2(2:,9:) |
| 16 |
r2 => x2(2:,:) ! { dg-error "Assignment to contiguous pointer from non-contiguous target" } |
| 17 |
r2 => x2(:,2:3) |
| 18 |
r => x2(2:3,1) |
| 19 |
r => x(::1) |
| 20 |
r => x(::n) |
| 21 |
end program |