aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/gfortran.dg/associated_target_3.f90
blob: 423499a2f76439cbb2a53f70993a064b4a155652 (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
31
32
33
! { dg-do run }
!
! PR fortran/41777
!
module m
type t2
 integer :: i
end type t2
interface f
 module procedure f2
end interface f
contains
function f2(a)
  type(t2), pointer :: f2,a
  f2 => a
end function f2
end module m

use m
implicit none
type(t2), pointer :: a
allocate(a)
if (.not. associated(a,f(a))) call abort()
call cmpPtr(a,f2(a))
call cmpPtr(a,f(a))
deallocate(a)
contains
  subroutine cmpPtr(a,b)
    type(t2), pointer :: a,b
!    print *, associated(a,b)
    if (.not. associated (a, b)) call abort()
  end subroutine cmpPtr
end