Commit c52eae8d by Tobias Schlüter Committed by Tobias Schlüter

re PR fortran/14957 (testsuite issues)

fortran/
PR fortran/14957
* decl.c (gfc_match_end): Require END {SUBROUTINE|FUNCTION} for
contained procedure.

testsuite/
PR fortran/14957
* gfortran.fortran-torture/execute/stack_varsize.f90: Correct
        syntax errors in end statements of contained subroutines.

From-SVN: r83031
parent a13c7588
2004-06-12 Tobias Schlueter <tobias.schlueter@physik.uni-muenchen.de> 2004-06-12 Tobias Schlueter <tobias.schlueter@physik.uni-muenchen.de>
PR fortran/14957
* decl.c (gfc_match_end): Require END {SUBROUTINE|FUNCTION} for
contained procedure.
2004-06-12 Tobias Schlueter <tobias.schlueter@physik.uni-muenchen.de>
PR fortran/12841 PR fortran/12841
* interface.c (compare_parameter, compare_actual_formal): Don't * interface.c (compare_parameter, compare_actual_formal): Don't
check types and array shapes for NULL() check types and array shapes for NULL()
......
...@@ -1875,10 +1875,15 @@ gfc_match_end (gfc_statement * st) ...@@ -1875,10 +1875,15 @@ gfc_match_end (gfc_statement * st)
if (gfc_match_eos () == MATCH_YES) if (gfc_match_eos () == MATCH_YES)
{ {
state = gfc_current_state ();
if (*st == ST_ENDIF || *st == ST_ENDDO || *st == ST_END_SELECT if (*st == ST_ENDIF || *st == ST_ENDDO || *st == ST_END_SELECT
|| *st == ST_END_INTERFACE || *st == ST_END_FORALL || *st == ST_END_INTERFACE || *st == ST_END_FORALL
|| *st == ST_END_WHERE) || *st == ST_END_WHERE
|| /* A contained procedure requires END FUNCTION/SUBROUTINE. */
((state == COMP_FUNCTION || state == COMP_SUBROUTINE)
&& gfc_state_stack->previous != NULL
&& gfc_state_stack->previous->state == COMP_CONTAINS))
{ {
gfc_error ("%s statement expected at %C", gfc_error ("%s statement expected at %C",
......
2004-06-12 Tobias Schlueter <tobias.schlueter@physik.uni-muenchen.de> 2004-06-12 Tobias Schlueter <tobias.schlueter@physik.uni-muenchen.de>
PR fortran/14957
* gfortran.fortran-torture/execute/stack_varsize.f90: Correct
syntax errors in end statements of contained subroutines.
2004-06-12 Tobias Schlueter <tobias.schlueter@physik.uni-muenchen.de>
PR fortran/12841 PR fortran/12841
* gfortran.fortran-torture/execute/null_arg.f90: New test. * gfortran.fortran-torture/execute/null_arg.f90: New test.
......
...@@ -17,7 +17,7 @@ contains ...@@ -17,7 +17,7 @@ contains
k = 30 k = 30
if ((a .ne. 10.0).or.(b(1) .ne. 20.0).or.(c(1) .ne. 30.0)) call abort if ((a .ne. 10.0).or.(b(1) .ne. 20.0).or.(c(1) .ne. 30.0)) call abort
if ((m .ne. 10).or.(n(256,4) .ne. 20).or.(k(1,1024) .ne. 30)) call abort if ((m .ne. 10).or.(n(256,4) .ne. 20).or.(k(1,1024) .ne. 30)) call abort
end end subroutine
! Local variables defined in recursive subroutine are always put on stack. ! Local variables defined in recursive subroutine are always put on stack.
recursive subroutine sub2 (n) recursive subroutine sub2 (n)
...@@ -26,5 +26,5 @@ contains ...@@ -26,5 +26,5 @@ contains
if (n .ge. 1) call sub2 (n-1) if (n .ge. 1) call sub2 (n-1)
if (a(1) .ne. 42) call abort if (a(1) .ne. 42) call abort
a (1) = 0 a (1) = 0
end end subroutine
end end
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment