view gcc/testsuite/gfortran.dg/generic_25.f90 @ 128:fe568345ddd5

fix CbC-example
author mir3636
date Wed, 11 Apr 2018 19:32:28 +0900
parents 04ced10e8804
children 84e7813d76e9
line wrap: on
line source

! { dg-do run }
!
! PR 45521: [F08] GENERIC resolution with ALLOCATABLE/POINTER and PROCEDURE
!
! Contributed by <wangmianzhi1@linuxmail.org>

  interface test
    procedure testAlloc
    procedure testPtr
  end interface

  integer, allocatable :: a1
  integer, pointer :: a2

  if (.not.test(a1)) call abort()
  if (test(a2)) call abort()
  
contains

  logical function testAlloc(obj)
    integer, allocatable :: obj
    testAlloc = .true.
  end function
  
  logical function testPtr(obj)
    integer, pointer :: obj
    testPtr = .false.
  end function
  
end