aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gfortran.dg/statement_function_2.f90
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/gfortran.dg/statement_function_2.f90')
-rw-r--r--gcc/testsuite/gfortran.dg/statement_function_2.f9026
1 files changed, 26 insertions, 0 deletions
diff --git a/gcc/testsuite/gfortran.dg/statement_function_2.f90 b/gcc/testsuite/gfortran.dg/statement_function_2.f90
new file mode 100644
index 00000000000..703ca1716ca
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/statement_function_2.f90
@@ -0,0 +1,26 @@
+! { dg-do compile }
+! PR fortran/54223
+subroutine r(d)
+ implicit none
+ integer, optional :: d
+ integer :: h, q
+ q(d) = d + 1 ! statement function statement
+ h = q(d)
+end subroutine r
+
+subroutine s(x)
+ implicit none
+ integer, optional :: x
+ integer :: g, z
+ g(x) = x + 1 ! statement function statement
+ z = g() ! { dg-error "Missing actual argument" }
+end subroutine s
+
+subroutine t(a)
+ implicit none
+ integer :: a
+ integer :: f, y
+ f(a) = a + 1 ! statement function statement
+ y = f() ! { dg-error "Missing actual argument" }
+end subroutine t
+! { dg-prune-output " Obsolescent feature" }