mirror of
https://github.com/autc04/Retro68.git
synced 2024-06-28 11:30:19 +00:00
28 lines
647 B
Fortran
28 lines
647 B
Fortran
! { dg-do run }
|
|
!
|
|
! PR 40646: [F03] array-valued procedure pointer components
|
|
!
|
|
! Original test case by Charlie Sharpsteen <chuck@sharpsteen.net>
|
|
! Modified by Janus Weil <janus@gcc.gnu.org>
|
|
|
|
module bugTestMod
|
|
implicit none
|
|
procedure(returnMat), pointer :: pp2
|
|
contains
|
|
function returnMat( a, b ) result( mat )
|
|
integer:: a, b
|
|
double precision, dimension(a,b):: mat
|
|
mat = 1d0
|
|
end function returnMat
|
|
end module bugTestMod
|
|
|
|
program bugTest
|
|
use bugTestMod
|
|
implicit none
|
|
procedure(returnMat), pointer :: pp
|
|
pp => returnMat
|
|
if (sum(pp(2,2))/=4) STOP 1
|
|
pp2 => returnMat
|
|
if (sum(pp2(3,2))/=6) STOP 2
|
|
end program bugTest
|