summaryrefslogtreecommitdiffstats
path: root/gcc/testsuite/gfortran.dg/generic_25.f90
blob: 39b7e23eb0f6009ed4a7def424f060136d9e6b0b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
! { 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
OpenPOWER on IntegriCloud