mirror of
https://github.com/autc04/Retro68.git
synced 2024-09-28 18:56:06 +00:00
33 lines
574 B
Fortran
33 lines
574 B
Fortran
! { dg-do run }
|
|
!
|
|
! PR 45521: [F08] GENERIC resolution with ALLOCATABLE/POINTER and PROCEDURE
|
|
!
|
|
! Contributed by Janus Weil <janus@gcc.gnu.org>
|
|
|
|
module m
|
|
implicit none
|
|
interface testIF
|
|
module procedure test1
|
|
module procedure test2
|
|
end interface
|
|
contains
|
|
real function test1 (obj)
|
|
real :: obj
|
|
test1 = obj
|
|
end function
|
|
real function test2 (pr)
|
|
procedure(real) :: pr
|
|
test2 = pr(0.)
|
|
end function
|
|
end module
|
|
|
|
program test
|
|
use m
|
|
implicit none
|
|
intrinsic :: cos
|
|
|
|
if (testIF(2.0)/=2.0) STOP 1
|
|
if (testIF(cos)/=1.0) STOP 2
|
|
|
|
end program
|