]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
Really add the new testsuite files missing from commit r207854
authorTobias Burnus <burnus@gcc.gnu.org>
Tue, 18 Feb 2014 22:29:00 +0000 (23:29 +0100)
committerTobias Burnus <burnus@gcc.gnu.org>
Tue, 18 Feb 2014 22:29:00 +0000 (23:29 +0100)
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.

From-SVN: r207855

gcc/testsuite/gfortran.dg/proc_ptr_45.f90 [new file with mode: 0644]
gcc/testsuite/gfortran.dg/proc_ptr_46.f90 [new file with mode: 0644]

diff --git a/gcc/testsuite/gfortran.dg/proc_ptr_45.f90 b/gcc/testsuite/gfortran.dg/proc_ptr_45.f90
new file mode 100644 (file)
index 0000000..a506473
--- /dev/null
@@ -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 (file)
index 0000000..2c05f59
--- /dev/null
@@ -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