diff options
Diffstat (limited to 'gcc/testsuite/gfortran.dg')
-rw-r--r-- | gcc/testsuite/gfortran.dg/submodule_33.f08 | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/gcc/testsuite/gfortran.dg/submodule_33.f08 b/gcc/testsuite/gfortran.dg/submodule_33.f08 new file mode 100644 index 0000000..b61d750d --- /dev/null +++ b/gcc/testsuite/gfortran.dg/submodule_33.f08 @@ -0,0 +1,20 @@ +! { dg-do compile } +! +! PR fortran/99798 +! This example used to trigger an ICE caused by a premature release of the G +! symbol (with its argument X) following the rejection of the subroutine in +! the submodule. + +module m + interface + module integer function g(x) + integer, intent(in) :: x + end + end interface +end +submodule(m) m2 +contains + subroutine g(x) ! { dg-error "FUNCTION attribute conflicts with SUBROUTINE" } + integer, intent(in) :: x ! { dg-error "Unexpected data declaration" } + end +end |