URL
https://opencores.org/ocsvn/openrisc/openrisc/trunk
Subversion Repositories openrisc
[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [gfortran.dg/] [proc_ptr_result_3.f90] - Rev 694
Compare with Previous | Blame | View Log
!{ dg-do run }!! PR 36704: Procedure pointer as function result!! Original test case from James Van Buskirk.!! Adapted by Janus Weil <janus@gcc.gnu.org>module store_subroutineimplicit noneabstract interfacesubroutine sub(i)integer, intent(inout) :: iend subroutine subend interfaceprocedure(sub), pointer, private :: psub => NULL()containssubroutine set_sub(x)procedure(sub) xpsub => xend subroutine set_subfunction get_sub()procedure(sub), pointer :: get_subget_sub => psubend function get_subend module store_subroutineprogram testuse store_subroutineimplicit noneprocedure(sub), pointer :: qsubinteger :: k = 1call my_sub(k)if (k/=3) call abortqsub => get_sub()call qsub(k)if (k/=9) call abortend program testrecursive subroutine my_sub(j)use store_subroutineimplicit noneinteger, intent(inout) :: jj = j*3call set_sub(my_sub)end subroutine my_sub! { dg-final { cleanup-modules "store_subroutine" } }
