| 1 |
! { dg-do compile } |
| 2 |
! |
| 3 |
! This tests the fix for PR36325, which corrected for the fact that a |
| 4 |
! specific or generic INTERFACE statement implies the EXTERNAL attibute. |
| 5 |
! |
| 6 |
! Contributed by Janus Weil <[email protected]> |
| 7 |
|
| 8 |
module a |
| 9 |
interface |
| 10 |
subroutine foo |
| 11 |
end subroutine |
| 12 |
end interface |
| 13 |
external foo ! { dg-error "Duplicate EXTERNAL attribute" } |
| 14 |
end module |
| 15 |
|
| 16 |
module b |
| 17 |
interface |
| 18 |
function sin (x) |
| 19 |
real :: sin, x |
| 20 |
end function |
| 21 |
end interface |
| 22 |
intrinsic sin ! { dg-error "EXTERNAL attribute conflicts with INTRINSIC attribute" } |
| 23 |
end module |
| 24 |
|
| 25 |
! argument checking was not done for external procedures with explicit interface |
| 26 |
program c |
| 27 |
interface |
| 28 |
subroutine bar(x) |
| 29 |
real :: x |
| 30 |
end subroutine |
| 31 |
end interface |
| 32 |
call bar() ! { dg-error "Missing actual argument" } |
| 33 |
end program |