PR inline-asm/84742
[official-gcc.git] / gcc / testsuite / gfortran.dg / submodule_22.f08
blob8ff5421c77eac12b6fa5371ef08c96dae672917a
1 ! { dg-do compile }
3 ! Test the fix for PR78474.
5 ! Contributed by Nicholas Brearly  <nick.brealey@cobham.com>
7 module mtop
8   implicit none
9   real :: r
10   interface
11     module subroutine sub1()
12     end subroutine
13   end interface
14   interface
15     module subroutine sub2()
16     end subroutine
17   end interface
18   interface
19     module subroutine sub3()
20     end subroutine
21   end interface
22 end module mtop
24 submodule (mtop) submod
25   implicit none
26   real :: s
27 contains
28   module subroutine sub1
29     r = 0.0
30   end subroutine sub1
31 end
33 submodule (mtop:submod) subsubmod
34 contains
35   module subroutine sub2
36     r = 1.0
37     s = 1.0
38   end subroutine sub2
39 end
41 submodule (mtop:submod:subsubmod) subsubsubmod ! { dg-error "Syntax error in SUBMODULE statement" }
42 contains
43   module subroutine sub3
44     r = 2.0
45     s = 2.0
46   end subroutine sub3
47 end