| 1 |
! { dg-do compile } |
| 2 |
! |
| 3 |
! Test the fix for PR78474. |
| 4 |
! |
| 5 |
! Contributed by Nicholas Brearly <[email protected]> |
| 6 |
! |
| 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 |
| 23 |
|
| 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 |
| 32 |
|
| 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 |
| 40 |
|
| 41 |
submodule (mtop:submod:subsubmod) subsubsubmod ! { dg-error "Syntax error in SUBMODULE statement" } |
| 42 |
contains |
| 43 |
module subroutine sub3 ! { dg-error "found outside of a module" } |
| 44 |
r = 2.0 ! { dg-error "Unexpected assignment" } |
| 45 |
s = 2.0 ! { dg-error "Unexpected assignment" } |
| 46 |
end subroutine sub3 ! { dg-error "Expecting END PROGRAM statement" } |
| 47 |
end |