aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/gfortran.fortran-torture/execute/module_interface_2.f90
diff options
context:
space:
mode:
Diffstat (limited to 'gcc-4.9/gcc/testsuite/gfortran.fortran-torture/execute/module_interface_2.f90')
-rw-r--r--gcc-4.9/gcc/testsuite/gfortran.fortran-torture/execute/module_interface_2.f9029
1 files changed, 29 insertions, 0 deletions
diff --git a/gcc-4.9/gcc/testsuite/gfortran.fortran-torture/execute/module_interface_2.f90 b/gcc-4.9/gcc/testsuite/gfortran.fortran-torture/execute/module_interface_2.f90
new file mode 100644
index 000000000..dba736654
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gfortran.fortran-torture/execute/module_interface_2.f90
@@ -0,0 +1,29 @@
+! Test generic interfaces declared in modules.
+! We used to get the name mangling wrong for these.
+module module_interface_2
+ interface foo
+ subroutine myfoo (i)
+ integer i
+ end subroutine
+ module procedure bar
+ end interface
+contains
+subroutine bar (r)
+ real r
+
+ if (r .ne. 1.0) call abort ()
+end subroutine
+end module
+
+subroutine myfoo (i)
+ integer i
+
+ if (i .ne. 42) call abort ()
+end subroutine
+
+program test
+ use module_interface_2
+
+ call foo (42)
+ call foo (1.0)
+end program