aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/gfortran.dg/ptr-func-2.f90
diff options
context:
space:
mode:
Diffstat (limited to 'gcc-4.9/gcc/testsuite/gfortran.dg/ptr-func-2.f90')
-rw-r--r--gcc-4.9/gcc/testsuite/gfortran.dg/ptr-func-2.f9024
1 files changed, 24 insertions, 0 deletions
diff --git a/gcc-4.9/gcc/testsuite/gfortran.dg/ptr-func-2.f90 b/gcc-4.9/gcc/testsuite/gfortran.dg/ptr-func-2.f90
new file mode 100644
index 000000000..8275f14c7
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gfortran.dg/ptr-func-2.f90
@@ -0,0 +1,24 @@
+! { dg-do compile }
+! { dg-options "-std=f2003 -fall-intrinsics" }
+!
+! PR fortran/46100
+!
+! Pointer function as definable actual argument
+! - a Fortran 2008 feature
+!
+integer, target :: tgt
+call one (two ()) ! { dg-error "Fortran 2008: Pointer functions" }
+if (tgt /= 774) call abort ()
+contains
+ subroutine one (x)
+ integer, intent(inout) :: x
+ if (x /= 34) call abort ()
+ x = 774
+ end subroutine one
+ function two ()
+ integer, pointer :: two
+ two => tgt
+ two = 34
+ end function two
+end
+