re PR fortran/48821 (IMPORT :: dummy_arg is rejected, while "IMPORT" imports it)
authorTobias Burnus <burnus@net-b.de>
Sat, 30 Apr 2011 16:33:47 +0000 (18:33 +0200)
committerTobias Burnus <burnus@gcc.gnu.org>
Sat, 30 Apr 2011 16:33:47 +0000 (18:33 +0200)
2011-04-30  Tobias Burnus  <burnus@net-b.de>

       PR fortran/48821
       * gfortran.dg/import9.f90: New, proper test.
       * gfortran.dg/interface_37.f90: Remove bogus
       test (bogus copy of interface_36.f90).

From-SVN: r173221

gcc/fortran/ChangeLog
gcc/testsuite/ChangeLog
gcc/testsuite/gfortran.dg/import9.f90 [new file with mode: 0644]
gcc/testsuite/gfortran.dg/interface_37.f90 [deleted file]

index 07d73768154dceee6e20d8151c53b988f3071601..66f744aebce3439df01889fbc0a0af242af0b6e9 100644 (file)
@@ -1,6 +1,6 @@
 2011-04-30  Tobias Burnus  <burnus@net-b.de>
 
-       PR fortran/48800
+       PR fortran/48821
        * decl.c (gfc_match_import): Don't try to find the
        symbol if already found.
 
index 1a802f00ec6b24cdb86560e3def7d8a8445ab3e3..d3d88c8a5029bd99d162f67c37313ff19e649184 100644 (file)
@@ -1,6 +1,13 @@
 2011-04-30  Tobias Burnus  <burnus@net-b.de>
 
-       PR fortran/48800
+       PR fortran/48821
+       * gfortran.dg/import9.f90: New, proper test.
+       * gfortran.dg/interface_37.f90: Remove bogus
+       test (bogus copy of interface_36.f90).
+
+2011-04-30  Tobias Burnus  <burnus@net-b.de>
+
+       PR fortran/48821
        * gfortran.dg/interface_37.f90: New.
 
 2011-04-30  Paul Thomas  <pault@gcc.gnu.org>
diff --git a/gcc/testsuite/gfortran.dg/import9.f90 b/gcc/testsuite/gfortran.dg/import9.f90
new file mode 100644 (file)
index 0000000..4ed5cdf
--- /dev/null
@@ -0,0 +1,30 @@
+! { dg-do compile }
+!
+! PR fortran/48821
+!
+! Contributed by Daniel Carrera
+!
+
+contains
+     pure subroutine rk4_vec(t, Y, dY, h)
+         real, intent(inout) :: t, Y(:)
+         real, intent(in) :: h
+         real, dimension(size(Y)) :: k1, k2, k3, k4
+
+         interface
+             pure function dY(t0, y0)
+                 import :: Y
+                 real, intent(in) :: t0, y0(size(Y))
+                 real :: dY(size(y0))
+             end function
+         end interface
+
+         k1 = dY(t, Y)
+         k2 = dY(t + h/2, Y + k1*h/2)
+         k3 = dY(t + h/2, Y + k2*h/2)
+         k4 = dY(t + h  , Y + k3*h)
+
+         Y = Y + (k1 + 2*k2 + 2*k3 + k4) * h/6
+         t = t + h
+     end subroutine
+end
diff --git a/gcc/testsuite/gfortran.dg/interface_37.f90 b/gcc/testsuite/gfortran.dg/interface_37.f90
deleted file mode 100644 (file)
index 8dbc276..0000000
+++ /dev/null
@@ -1,31 +0,0 @@
---- /dev/null
-+++ gcc/testsuite/gfortran.dg/interface_36.f90 2011-04-29 19:10:43.000000000 +0200
-@@ -0,0 +1,28 @@
-+! { dg-do compile }
-+!
-+! PR fortran/48800
-+!
-+! Contributed by Daniel Carrera
-+!
-+     pure function runge_kutta_step(t, r_, dr, h) result(res)
-+         real, intent(in) :: t, r_(:), h
-+         real, dimension(:), allocatable :: k1, k2, k3, k4, res
-+         integer :: N
-+
-+         interface
-+             pure function dr(t, r_)  ! { dg-error "cannot have a deferred shape" }
-+                 real, intent(in) :: t, r_(:)
-+                 real :: dr(:)
-+             end function
-+         end interface
-+
-+         N = size(r_)
-+         allocate(k1(N),k2(N),k3(N),k4(N),res(N))
-+
-+         k1 = dr(t, r_)
-+         k2 = dr(t + h/2, r_ + k1*h/2)
-+         k3 = dr(t + h/2, r_ + k2*h/2)
-+         k4 = dr(t + h  , r_ + k3*h)
-+
-+         res = r_ + (k1 + 2*k2 + 2*k3 + k4) * h/6
-+     end function