view gcc/testsuite/gfortran.dg/pointer_target_3.f90 @ 158:494b0b89df80 default tip

...
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Mon, 25 May 2020 18:13:55 +0900
parents 04ced10e8804
children
line wrap: on
line source

! { dg-do compile }
!
! TARGET actual to POINTER dummy with INTENT(IN)
!
program test
  implicit none
  integer, target :: a
  integer :: b
  call foo(a) ! OK
  call foo(b) ! { dg-error "must be a pointer" }
  call bar(a) ! { dg-error "must be a pointer" }
  call bar(b) ! { dg-error "must be a pointer" }
contains
  subroutine foo(p)
    integer, pointer, intent(in) :: p
  end subroutine foo
  subroutine bar(p)
    integer, pointer :: p
  end subroutine bar
end program test