2011-05-23 Tom de Vries <tom@codesourcery.com>
[official-gcc.git] / gcc / testsuite / gfortran.dg / proc_ptr_comp_29.f90
blob94c59cd1a3bb3d4d5e254698834604bdd33ec725
1 ! { dg-do run }
3 ! PR 47240: [F03] segfault with procedure pointer component
5 ! Contributed by Martien Hulsen <m.a.hulsen@tue.nl>
7 type t
8 procedure (fun), pointer, nopass :: p
9 end type
10 type(t) :: x
11 real, dimension(2) :: r
12 x%p => fun
13 r = evaluate (x%p)
14 if (r(1) /= 5 .and. r(2) /= 6) call abort()
15 contains
16 function fun ()
17 real, dimension(2) :: fun
18 fun = (/ 5, 6 /)
19 end function
20 function evaluate ( dummy )
21 real, dimension(2) :: evaluate
22 procedure(fun) :: dummy
23 evaluate = dummy ()
24 end function
25 end