OSDN Git Service

PR fortran/24005
authorkargl <kargl@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 22 Sep 2005 22:47:45 +0000 (22:47 +0000)
committerkargl <kargl@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 22 Sep 2005 22:47:45 +0000 (22:47 +0000)
gfortran.dg/interface_1.f90: New test.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@104545 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/testsuite/ChangeLog
gcc/testsuite/gfortran.dg/interface_1.f90 [new file with mode: 0644]

index ab82adc..3f32377 100644 (file)
@@ -1,3 +1,8 @@
+2005-09-22 Steven G. Kargl  <kargls@comcast.net>
+
+       PR fortran/24005
+       gfortran.dg/interface_1.f90: New test.
+
 2005-09-22  Erik Edelmann  <erik.edelmann@iki.fi>
        Tobias Schl"uter  <tobias.schlueter@physik.uni-muenchen.de>
 
diff --git a/gcc/testsuite/gfortran.dg/interface_1.f90 b/gcc/testsuite/gfortran.dg/interface_1.f90
new file mode 100644 (file)
index 0000000..e2562e1
--- /dev/null
@@ -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