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