| 1 |
! { dg-do run } |
| 2 |
! |
| 3 |
! PR 40646: [F03] array-valued procedure pointer components |
| 4 |
! |
| 5 |
! Original test case by Charlie Sharpsteen <[email protected]> |
| 6 |
! Modified by Janus Weil <[email protected]> |
| 7 |
|
| 8 |
module bugTestMod |
| 9 |
implicit none |
| 10 |
procedure(returnMat), pointer :: pp2 |
| 11 |
contains |
| 12 |
function returnMat( a, b ) result( mat ) |
| 13 |
integer:: a, b |
| 14 |
double precision, dimension(a,b):: mat |
| 15 |
mat = 1d0 |
| 16 |
end function returnMat |
| 17 |
end module bugTestMod |
| 18 |
|
| 19 |
program bugTest |
| 20 |
use bugTestMod |
| 21 |
implicit none |
| 22 |
procedure(returnMat), pointer :: pp |
| 23 |
pp => returnMat |
| 24 |
if (sum(pp(2,2))/=4) STOP 1 |
| 25 |
pp2 => returnMat |
| 26 |
if (sum(pp2(3,2))/=6) STOP 2 |
| 27 |
end program bugTest |