From 821bde0f832740ac9466302792809819ef1217cc Mon Sep 17 00:00:00 2001 From: "Steven G. Kargl" Date: Thu, 22 Sep 2005 22:47:45 +0000 Subject: [PATCH] re PR fortran/24005 (Ambiguous INTERFACE leads to seg fault) PR fortran/24005 gfortran.dg/interface_1.f90: New test. From-SVN: r104545 --- gcc/testsuite/ChangeLog | 5 +++ gcc/testsuite/gfortran.dg/interface_1.f90 | 40 +++++++++++++++++++++++ 2 files changed, 45 insertions(+) create mode 100644 gcc/testsuite/gfortran.dg/interface_1.f90 diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index ab82adcf84df..3f32377eff0a 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2005-09-22 Steven G. Kargl + + PR fortran/24005 + gfortran.dg/interface_1.f90: New test. + 2005-09-22 Erik Edelmann Tobias Schl"uter diff --git a/gcc/testsuite/gfortran.dg/interface_1.f90 b/gcc/testsuite/gfortran.dg/interface_1.f90 new file mode 100644 index 000000000000..e2562e10417f --- /dev/null +++ b/gcc/testsuite/gfortran.dg/interface_1.f90 @@ -0,0 +1,40 @@ +! { dg-do compile } +! This program would segfault without the patch for PR fortran/24005. +module y + ! + ! If private statement is removed, then we get a bunch of errors + ! + private f + ! + ! If we rename 'f' in module y to say 'g', then gfortran correctly + ! identifies ambiguous as being ambiguous. + ! + interface ambiguous + module procedure f + end interface + + contains + + real function f(a) + real a + f = a + end function + +end module y + +module z + + use y + + interface ambiguous + module procedure f ! { dg-error "in generic interface" "" } + end interface + + contains + + real function f(a) + real a + f = a + end function + +end module z -- 2.43.5