summaryrefslogtreecommitdiff
path: root/gcc/testsuite
diff options
context:
space:
mode:
authoreedelman <eedelman@138bc75d-0d04-0410-961f-82ee72b054a4>2005-12-15 00:47:13 +0000
committereedelman <eedelman@138bc75d-0d04-0410-961f-82ee72b054a4>2005-12-15 00:47:13 +0000
commitfc41ffae81c48238429873c1731983468ac0398f (patch)
treea05e348fcff6ea06e396da59a74aab213dbd8ee5 /gcc/testsuite
parent54380608226fc95bc68ed5636e120e89007b3d17 (diff)
downloadgcc-fc41ffae81c48238429873c1731983468ac0398f.tar.gz
fortran/
2005-12-14 Erik Edelmann <eedelman@gcc.gnu.org> PR fortran/18197 * resolve.c (resolve_formal_arglist): Remove code to set the type of a function symbol from it's result symbol. testsuite/ 2005-12-14 Erik Edelmann <eedelman@gcc.gnu.org> PR fortran/18197 * gfortran.dg/dummy_functions_1.f90: New. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@108555 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/testsuite')
-rw-r--r--gcc/testsuite/ChangeLog6
-rw-r--r--gcc/testsuite/gfortran.dg/dummy_functions_1.f9036
2 files changed, 42 insertions, 0 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 85a48284f1d..664fa4ab8fa 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,8 @@
+2005-12-14 Erik Edelmann <eedelman@gcc.gnu.org>
+
+ PR fortran/18197
+ * gfortran.dg/dummy_functions_1.f90: New.
+
2005-12-14 Ulrich Weigand <uweigand@de.ibm.com>
PR rtl-optimization/25310
@@ -38939,3 +38944,4 @@ rlsruhe.de>
correspond to c-torture 1.11.
* New file.
+
diff --git a/gcc/testsuite/gfortran.dg/dummy_functions_1.f90 b/gcc/testsuite/gfortran.dg/dummy_functions_1.f90
new file mode 100644
index 00000000000..dfcf644c255
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/dummy_functions_1.f90
@@ -0,0 +1,36 @@
+! { dg-do compile }
+! PR 18197: Check that dummy functions with RESULT variable and dimension works.
+module innerfun
+contains
+ function f(n,x) result(y)
+ integer, intent(in) :: n
+ real, dimension(:), intent(in) :: x
+ real, dimension(n) :: y
+ y = 1
+ end function f
+end module innerfun
+
+module outerfun
+contains
+ subroutine foo(n,funname)
+ integer, intent(in) :: n
+ real, dimension(n) :: y
+ real, dimension(2) :: x
+ interface
+ function funname(n,x) result(y)
+ integer, intent(in) :: n
+ real, dimension(:), intent(in) :: x
+ real, dimension(n) :: y
+ end function funname
+ end interface
+
+ y = funname(n, (/ 0.2, 0.3 /) )
+
+ end subroutine foo
+end module outerfun
+
+program test
+ use outerfun
+ use innerfun
+ call foo(3,f)
+end program test