| 1 |
! { dg-do compile } |
| 2 |
! PR fortran/pr87907 |
| 3 |
! Original testcase contributed by Gerhard Stienmetz <gscfq at t-online dot de> |
| 4 |
module m |
| 5 |
interface |
| 6 |
module function g(x) result(z) |
| 7 |
integer, intent(in) :: x |
| 8 |
integer, allocatable :: z |
| 9 |
end |
| 10 |
end interface |
| 11 |
end |
| 12 |
|
| 13 |
submodule(m) m2 |
| 14 |
contains |
| 15 |
subroutine g(x) ! { dg-error "FUNCTION attribute conflicts with SUBROUTINE" } |
| 16 |
end |
| 17 |
end |
| 18 |
|
| 19 |
program p |
| 20 |
use m |
| 21 |
integer :: x = 3 |
| 22 |
call g(x) |
| 23 |
end |
| 24 |
|
| 25 |
! { dg-prune-output "Two main PROGRAMs" } |