From 4ea4bf9c33f47bc573d31e86ce353cbcc0c37f05 Mon Sep 17 00:00:00 2001 From: Tobias Burnus Date: Tue, 18 Feb 2014 23:29:00 +0100 Subject: Really add the new testsuite files missing from commit r207854 2014-02-18 Tobias Burnus PR fortran/49397 * gfortran.dg/proc_ptr_45.f90: New. * gfortran.dg/proc_ptr_46.f90: New. From-SVN: r207855 --- gcc/testsuite/gfortran.dg/proc_ptr_45.f90 | 24 ++++++++++++++++++++++++ gcc/testsuite/gfortran.dg/proc_ptr_46.f90 | 14 ++++++++++++++ 2 files changed, 38 insertions(+) create mode 100644 gcc/testsuite/gfortran.dg/proc_ptr_45.f90 create mode 100644 gcc/testsuite/gfortran.dg/proc_ptr_46.f90 (limited to 'gcc') diff --git a/gcc/testsuite/gfortran.dg/proc_ptr_45.f90 b/gcc/testsuite/gfortran.dg/proc_ptr_45.f90 new file mode 100644 index 0000000..a506473 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/proc_ptr_45.f90 @@ -0,0 +1,24 @@ +! { dg-do compile } +! +! PR fortran/49397 +! +! Valid per IR F08/0060 and F2008Corr2, C729 +! +Program m5 + Print *,f() +Contains + Subroutine s + Procedure(Real),Pointer :: p + Print *,g() + p => f ! (1) + Print *,p() + p => g ! (2) + Print *,p() + End Subroutine +End Program +Function f() + f = 1 +End Function +Function g() + g = 2 +End Function diff --git a/gcc/testsuite/gfortran.dg/proc_ptr_46.f90 b/gcc/testsuite/gfortran.dg/proc_ptr_46.f90 new file mode 100644 index 0000000..2c05f59 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/proc_ptr_46.f90 @@ -0,0 +1,14 @@ +! { dg-do compile } +! +! PR fortran/49397 +! +! Invalid per IR F08/0060 and F2008Corr2, C729 +! + +! Print *,f() ! << Valid when uncommented +Contains + Subroutine s + Procedure(Real),Pointer :: p + p => f ! { dg-error "Procedure pointer target 'f' at .1. must be either an intrinsic, host or use associated, referenced or have the EXTERNAL attribute" } + End Subroutine +End -- cgit v1.1