2008-07-08 Paul Thomas <pault@gcc.gnu.org>
[official-gcc.git] / gcc / testsuite / gfortran.dg / proc_ptr_21.f90
blob312dca941baecacc4d3bf95b8711b928c9d42e73
1 ! { dg-do run }
2 ! Tests the fix for PR40591 in which the interface 'sub2'
3 ! for 'pptr2' was not resolved.
5 ! Contributed by Tobias Burnus <burnus@gcc.gnu.org>
7 program main
8 call test
9 contains
10 subroutine sub1(arg)
11 integer arg
12 arg = arg + 1
13 end subroutine sub1
14 subroutine test()
15 procedure(sub1), pointer :: pptr1
16 procedure(sub2), pointer :: pptr2
17 integer i
18 pptr1 => sub1
19 call pptr1 (i)
20 pptr1 => sub2
21 call pptr1 (i)
22 pptr2 => sub1
23 call pptr2 (i)
24 pptr2 => sub2
25 call pptr2 (i)
26 if (i .ne. 22) call abort
27 end subroutine test
28 subroutine sub2(arg)
29 integer arg
30 arg = arg + 10
31 end subroutine sub2
32 end program main