2017-12-08 Richard Biener <rguenther@suse.de>
[official-gcc.git] / gcc / testsuite / gfortran.dg / proc_ptr_41.f90
blob534ab0fb5a72b48680a5410a377000b399f63676
1 ! { dg-do compile }
3 ! PR 56968: [4.7/4.8/4.9 Regression] [F03] Issue with a procedure defined with a generic name returning procedure pointer
5 ! Contributed by Samuel Debionne <samuel.debionne@ujf-grenoble.fr>
7 module test
9 interface generic_name_get_proc_ptr
10 module procedure specific_name_get_proc_ptr
11 end interface
13 abstract interface
14 double precision function foo(arg1)
15 real, intent(in) :: arg1
16 end function
17 end interface
19 contains
21 function specific_name_get_proc_ptr() result(res)
22 procedure(foo), pointer :: res
23 end function
25 end module test
27 program crash_test
28 use :: test
30 procedure(foo), pointer :: ptr
32 ptr => specific_name_get_proc_ptr()
33 ptr => generic_name_get_proc_ptr()
35 end program