| 1 |
! { dg-do compile } |
| 2 |
! PR fortran/120355 - this was rejected because the typespec from |
| 3 |
! the RESULT clause was not picked up. |
| 4 |
! Test case [email protected]. |
| 5 |
|
| 6 |
program p |
| 7 |
implicit none |
| 8 |
integer :: i,j |
| 9 |
interface |
| 10 |
function s(x) result(y) |
| 11 |
implicit none |
| 12 |
integer, intent(in) :: x |
| 13 |
integer :: y |
| 14 |
end function s |
| 15 |
end interface |
| 16 |
i = 0 |
| 17 |
call t(s,i,j) |
| 18 |
contains |
| 19 |
subroutine t(f,x,y) |
| 20 |
implicit none |
| 21 |
integer, intent(in) :: x |
| 22 |
integer, intent(out) :: y |
| 23 |
interface |
| 24 |
function f(x) result(y) |
| 25 |
implicit none |
| 26 |
integer, intent(in) :: x |
| 27 |
integer :: y |
| 28 |
end function f |
| 29 |
end interface |
| 30 |
y = f(x) |
| 31 |
end subroutine t |
| 32 |
end program p |
| 33 |
|
| 34 |
function s(x) result(y) |
| 35 |
implicit none |
| 36 |
integer, intent(in) :: x |
| 37 |
integer :: y |
| 38 |
y = 1 - x |
| 39 |
end function s |