1! { dg-do compile } 2program 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(::3) ! { dg-error "Assignment to contiguous pointer" } 14 r2 => x2(2:,:) ! { dg-error "Assignment to contiguous pointer" } 15 r2 => x2(:,2:3) 16 r => x2(2:3,1) 17 r => x(::1) 18 r => x(::n) ! { dg-error "Assignment to contiguous pointer" } 19end program 20