aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/gfortran.dg/assumed_charlen_function_6.f90
diff options
context:
space:
mode:
Diffstat (limited to 'gcc-4.9/gcc/testsuite/gfortran.dg/assumed_charlen_function_6.f90')
-rw-r--r--gcc-4.9/gcc/testsuite/gfortran.dg/assumed_charlen_function_6.f9035
1 files changed, 35 insertions, 0 deletions
diff --git a/gcc-4.9/gcc/testsuite/gfortran.dg/assumed_charlen_function_6.f90 b/gcc-4.9/gcc/testsuite/gfortran.dg/assumed_charlen_function_6.f90
new file mode 100644
index 000000000..ed4f9dd05
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gfortran.dg/assumed_charlen_function_6.f90
@@ -0,0 +1,35 @@
+! { dg-do compile }
+
+! PR fortran/41615
+! Output nicer error message for invalid assumed-len character function result
+! depending on what kind of contained procedure it is.
+
+module funcs
+ implicit none
+contains
+ function assumed_len(x) ! { dg-error "module procedure" }
+ character(*) assumed_len
+ integer, intent(in) :: x
+ end function assumed_len
+end module funcs
+
+module mod2
+ implicit none
+contains
+ subroutine mysub ()
+ contains
+ function assumed_len(x) ! { dg-error "internal function" }
+ character(*) assumed_len
+ integer, intent(in) :: x
+ end function assumed_len
+ end subroutine
+end module mod2
+
+program main
+ implicit none
+contains
+ function assumed_len(x) ! { dg-error "internal function" }
+ character(*) assumed_len
+ integer, intent(in) :: x
+ end function assumed_len
+end program main