view gcc/testsuite/gfortran.dg/proc_decl_12.f90 @ 144:8f4e72ab4e11

fix segmentation fault caused by nothing next cur_op to end
author Takahiro SHIMIZU <anatofuz@cr.ie.u-ryukyu.ac.jp>
date Sun, 23 Dec 2018 21:23:56 +0900
parents 84e7813d76e9
children
line wrap: on
line source

! { dg-do run }
!
! This tests the (partial) fix for PR35830, i.e. handling array arguments
! with the PROCEDURE statement.
!
! Contributed by Janus Weil <janus@gcc.gnu.org>

module m
contains
  subroutine one(a)
      integer a(1:3)
      if (any(a /= [1,2,3])) STOP 1
  end subroutine one
end module m

program test
  use m
  implicit none
  call foo(one)
contains
  subroutine foo(f)
    procedure(one) :: f
    call f([1,2,3])
  end subroutine foo
end program test