Mercurial > hg > CbC > CbC_gcc
view gcc/testsuite/gfortran.dg/proc_ptr_comp_24.f90 @ 127:4c56639505ff
fix function.c and add CbC-example Makefile
author | mir3636 |
---|---|
date | Wed, 11 Apr 2018 18:46:58 +0900 |
parents | 04ced10e8804 |
children |
line wrap: on
line source
! { dg-do compile } ! ! PR42045: [F03] passing a procedure pointer component to a procedure pointer dummy ! ! Contributed by John McFarland <john.mcfarland@swri.org> PROGRAM prog TYPE object PROCEDURE(), POINTER, NOPASS :: f END TYPE object TYPE container TYPE (object), POINTER :: o(:) END TYPE container TYPE (container) :: c TYPE (object) :: o1, o2 PROCEDURE(), POINTER :: f => NULL() o1%f => f CALL set_func(o2,f) CALL set_func(o2,o1%f) ALLOCATE( c%o(5) ) c%o(5)%f => f CALL set_func(o2,c%o(5)%f) CONTAINS SUBROUTINE set_func(o,f) TYPE (object) :: o PROCEDURE(), POINTER :: f o%f => f END SUBROUTINE set_func END PROGRAM prog