diff options
Diffstat (limited to 'gcc/testsuite/gfortran.dg/proc_ptr_comp_pass_3.f90')
-rw-r--r-- | gcc/testsuite/gfortran.dg/proc_ptr_comp_pass_3.f90 | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/gcc/testsuite/gfortran.dg/proc_ptr_comp_pass_3.f90 b/gcc/testsuite/gfortran.dg/proc_ptr_comp_pass_3.f90 new file mode 100644 index 000000000..add025cb0 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/proc_ptr_comp_pass_3.f90 @@ -0,0 +1,36 @@ +! { dg-do run } +! +! PR 39630: [F03] Procedure Pointer Components with PASS +! +! taken from "Fortran 95/2003 explained" (Metcalf, Reid, Cohen, 2004) + +type t + procedure(obp), pointer, pass(x) :: p + character(100) :: name +end type + +abstract interface + subroutine obp(w,x) + import :: t + integer :: w + class(t) :: x + end subroutine +end interface + +type(t) :: a +a%p => my_obp_sub +a%name = "doodoo" + +call a%p(32) + +contains + + subroutine my_obp_sub(w,x) + integer :: w + class(t) :: x + if (x%name/="doodoo") call abort() + if (w/=32) call abort() + end subroutine + +end + |