| 1 |
! { dg-do compile } |
| 2 |
! |
| 3 |
! Checks that the name clash between the two submodules 'mod_s' is an error. |
| 4 |
! |
| 5 |
! Contributed by Reinhold Bader <[email protected]> |
| 6 |
! |
| 7 |
module mod_a |
| 8 |
implicit none |
| 9 |
interface |
| 10 |
module subroutine p() |
| 11 |
end subroutine |
| 12 |
end interface |
| 13 |
end module |
| 14 |
|
| 15 |
submodule (mod_a) mod_s ! { dg-error "already being used as a MODULE" } |
| 16 |
end submodule |
| 17 |
|
| 18 |
submodule (mod_a:mod_s) b |
| 19 |
end submodule |
| 20 |
|
| 21 |
submodule (mod_a:b) mod_s ! { dg-error "already being used as a MODULE" } |
| 22 |
implicit none |
| 23 |
integer :: i=-2 |
| 24 |
contains |
| 25 |
module procedure p |
| 26 |
write(*,*) 'FAIL' |
| 27 |
end procedure |
| 28 |
end submodule |
| 29 |
|
| 30 |
module mod_s |
| 31 |
use mod_a |
| 32 |
implicit none |
| 33 |
integer :: i=2 |
| 34 |
end module |
| 35 |
|
| 36 |
program a_s |
| 37 |
use mod_s |
| 38 |
implicit none |
| 39 |
call p() |
| 40 |
end program |