diff options
Diffstat (limited to 'gcc/testsuite/gfortran.dg/proc_ptr_comp_39.f90')
-rw-r--r-- | gcc/testsuite/gfortran.dg/proc_ptr_comp_39.f90 | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/gcc/testsuite/gfortran.dg/proc_ptr_comp_39.f90 b/gcc/testsuite/gfortran.dg/proc_ptr_comp_39.f90 new file mode 100644 index 00000000000..cc4096a4ecc --- /dev/null +++ b/gcc/testsuite/gfortran.dg/proc_ptr_comp_39.f90 @@ -0,0 +1,32 @@ +! { dg-do compile } +! +! PR 63674: [F03] procedure pointer and non/pure procedure +! +! Contributed by Valery Weber <valeryweber@hotmail.com> + +program prog + interface + integer function nf() + end function + pure integer function pf() + end function + subroutine ns() + end subroutine + pure subroutine ps() + end subroutine + end interface + type :: t + procedure(nf), nopass, pointer :: nf => NULL() ! non-pure function + procedure(pf), nopass, pointer :: pf => NULL() ! pure function + procedure(ns), nopass, pointer :: ns => NULL() ! non-pure subroutine + procedure(ps), nopass, pointer :: ps => NULL() ! pure subroutine + end type +contains + pure integer function eval(a) + type(t), intent(in) :: a + eval = a%pf() + eval = a%nf() ! { dg-error "Reference to non-PURE function" } + call a%ps() + call a%ns() ! { dg-error "is not PURE" } + end function +end |