annotate gcc/testsuite/gfortran.dg/submodule_30.f08 @ 144:8f4e72ab4e11

fix segmentation fault caused by nothing next cur_op to end
author Takahiro SHIMIZU <anatofuz@cr.ie.u-ryukyu.ac.jp>
date Sun, 23 Dec 2018 21:23:56 +0900
parents 84e7813d76e9
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
111
kono
parents:
diff changeset
1 ! { dg-do run }
kono
parents:
diff changeset
2 !
kono
parents:
diff changeset
3 ! Test the fix for PR82550 in which the reference to 'p' in 'foo'
kono
parents:
diff changeset
4 ! was not being correctly handled.
kono
parents:
diff changeset
5 !
kono
parents:
diff changeset
6 ! Contributed by Reinhold Bader <Bader@lrz.de>
kono
parents:
diff changeset
7 !
kono
parents:
diff changeset
8 module m_subm_18_pos
kono
parents:
diff changeset
9 implicit none
kono
parents:
diff changeset
10 integer :: i = 0
kono
parents:
diff changeset
11 interface
kono
parents:
diff changeset
12 module subroutine foo(fun_ptr)
kono
parents:
diff changeset
13 procedure(p), pointer, intent(out) :: fun_ptr
kono
parents:
diff changeset
14 end subroutine
kono
parents:
diff changeset
15 end interface
kono
parents:
diff changeset
16 contains
kono
parents:
diff changeset
17 subroutine p()
kono
parents:
diff changeset
18 i = 1
kono
parents:
diff changeset
19 end subroutine p
kono
parents:
diff changeset
20 end module m_subm_18_pos
kono
parents:
diff changeset
21 submodule (m_subm_18_pos) subm_18_pos
kono
parents:
diff changeset
22 implicit none
kono
parents:
diff changeset
23 contains
kono
parents:
diff changeset
24 module subroutine foo(fun_ptr)
kono
parents:
diff changeset
25 procedure(p), pointer, intent(out) :: fun_ptr
kono
parents:
diff changeset
26 fun_ptr => p
kono
parents:
diff changeset
27 end subroutine
kono
parents:
diff changeset
28 end submodule
kono
parents:
diff changeset
29 program p_18_pos
kono
parents:
diff changeset
30 use m_subm_18_pos
kono
parents:
diff changeset
31 implicit none
kono
parents:
diff changeset
32 procedure(), pointer :: x
kono
parents:
diff changeset
33 call foo(x)
kono
parents:
diff changeset
34 call x()
kono
parents:
diff changeset
35 if (i == 1) then
kono
parents:
diff changeset
36 write(*,*) 'OK'
kono
parents:
diff changeset
37 else
kono
parents:
diff changeset
38 write(*,*) 'FAIL'
131
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
39 STOP 1
111
kono
parents:
diff changeset
40 end if
kono
parents:
diff changeset
41 end program p_18_pos
kono
parents:
diff changeset
42