aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/gfortran.fortran-torture/execute/module_interface_2.f90
blob: dba736654c40dd6895815795223fae345082f6d3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
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