summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorburnus <burnus@138bc75d-0d04-0410-961f-82ee72b054a4>2014-02-18 22:29:00 +0000
committerburnus <burnus@138bc75d-0d04-0410-961f-82ee72b054a4>2014-02-18 22:29:00 +0000
commit75468bd5524d1220de385401b2c83f61ca38e300 (patch)
tree9e5141a9f6827df2c2ecea7abdb09feb377600f5
parent77d080ca8ed176e583ae78645397be0c0c0b4b40 (diff)
downloadgcc-75468bd5524d1220de385401b2c83f61ca38e300.tar.gz
Really add the new testsuite files missing from commit r207854
2014-02-18 Tobias Burnus <burnus@net-b.de> PR fortran/49397 * gfortran.dg/proc_ptr_45.f90: New. * gfortran.dg/proc_ptr_46.f90: New. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@207855 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--gcc/testsuite/gfortran.dg/proc_ptr_45.f9024
-rw-r--r--gcc/testsuite/gfortran.dg/proc_ptr_46.f9014
2 files changed, 38 insertions, 0 deletions
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 00000000000..a506473ad95
--- /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 00000000000..2c05f59d8a1
--- /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