aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gfortran.dg/submodule_13.f08
blob: 6a4d2ad113e5e440d6b62d96df7a9260ac8c4341 (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
30
31
32
! { dg-do compile }
!
! Checks the fix for PR68534 in which checks for the number
! failed if either the interface or the module procedure had
! no dummies.
!
! Reported on clf at:
! https://groups.google.com/forum/#!topic/comp.lang.fortran/-ZgbM5qkFmc
!
module m
  implicit none
    interface
      module subroutine foo()
      end subroutine foo

      module subroutine bar(i)
        integer, intent(inout) :: i
      end subroutine bar
   end interface
end module m

submodule(m) sm
contains
  module subroutine foo(i) ! { dg-error "Mismatch in number of MODULE PROCEDURE formal" }
    integer, intent(inout) :: i
    i = 42
  end subroutine foo

  module subroutine bar ! { dg-error "Mismatch in number of MODULE PROCEDURE formal" }
    print *, "bar"
  end subroutine bar
end submodule sm