Debian Codegraph @

gcc/testsuite/gfortran.dg/generic_25.f90

raw
1 ! { dg-do run }
2 !
3 ! PR 45521: [F08] GENERIC resolution with ALLOCATABLE/POINTER and PROCEDURE
4 !
5 ! Contributed by <[email protected]>
6
7 interface test
8 procedure testAlloc
9 procedure testPtr
10 end interface
11
12 integer, allocatable :: a1
13 integer, pointer :: a2
14
15 if (.not.test(a1)) STOP 1
16 if (test(a2)) STOP 2
17
18 contains
19
20 logical function testAlloc(obj)
21 integer, allocatable :: obj
22 testAlloc = .true.
23 end function
24
25 logical function testPtr(obj)
26 integer, pointer :: obj
27 testPtr = .false.
28 end function
29
30 end