summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gfortran.dg/pointer_remapping_1.f90
blob: d360c4223ccbcaf5568a4d128d440ff4bbab51e5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
! { dg-do compile }
! { dg-options "-std=f95" }

! PR fortran/29785
! PR fortran/45016
! Check for F2003 rejection of pointer remappings.

! Contributed by Daniel Kraft, d@domob.eu.

PROGRAM main
  IMPLICIT NONE
  INTEGER, TARGET :: arr(12)
  INTEGER, POINTER :: vec(:), mat(:, :)

  vec => arr ! This is ok.

  vec(2:) => arr ! { dg-error "Fortran 2003" }
  mat(1:2, 1:6) => arr ! { dg-error "Fortran 2003" }
END PROGRAM main