PR target/83368
[official-gcc.git] / gcc / testsuite / gfortran.dg / pointer_assign_1.f90
blobcfe8ad1700694a49a6125ad648ccf1dd7f0fd29c
1 ! { dg-do compile }
2 ! Tests fix for PR20838 - would ICE with vector subscript in
3 ! pointer assignment.
5 ! Contributed by Paul Thomas <pault@gcc.gnu.org>
7 integer, parameter, dimension(3) :: i = (/2,1,3/)
8 integer, dimension(3), target :: tar
9 integer, dimension(2, 3), target :: tar2
10 integer, dimension(:), pointer :: ptr
11 ptr => tar
12 ptr => tar(3:1:-1)
13 ptr => tar(i) ! { dg-error "with vector subscript" }
14 ptr => tar2(1, :)
15 ptr => tar2(2, i) ! { dg-error "with vector subscript" }
16 end