annotate gcc/testsuite/gfortran.dg/proc_ptr_comp_12.f90 @ 145:1830386684a0

gcc-9.2.0
author anatofuz
date Thu, 13 Feb 2020 11:34:05 +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 ! PR 40646: [F03] array-valued procedure pointer components
kono
parents:
diff changeset
4 !
kono
parents:
diff changeset
5 ! Original test case by Charlie Sharpsteen <chuck@sharpsteen.net>
kono
parents:
diff changeset
6 ! Modified by Janus Weil <janus@gcc.gnu.org>
kono
parents:
diff changeset
7
kono
parents:
diff changeset
8 module bugTestMod
kono
parents:
diff changeset
9 implicit none
kono
parents:
diff changeset
10 type:: boundTest
kono
parents:
diff changeset
11 procedure(returnMat), pointer, nopass:: test
kono
parents:
diff changeset
12 end type boundTest
kono
parents:
diff changeset
13 contains
kono
parents:
diff changeset
14 function returnMat( a, b ) result( mat )
kono
parents:
diff changeset
15 integer:: a, b
kono
parents:
diff changeset
16 double precision, dimension(a,b):: mat
kono
parents:
diff changeset
17 mat = 1d0
kono
parents:
diff changeset
18 end function returnMat
kono
parents:
diff changeset
19 end module bugTestMod
kono
parents:
diff changeset
20
kono
parents:
diff changeset
21 program bugTest
kono
parents:
diff changeset
22 use bugTestMod
kono
parents:
diff changeset
23 implicit none
kono
parents:
diff changeset
24 type( boundTest ):: testObj
kono
parents:
diff changeset
25 double precision, dimension(2,2):: testCatch
kono
parents:
diff changeset
26 testObj%test => returnMat
kono
parents:
diff changeset
27 testCatch = testObj%test(2,2)
kono
parents:
diff changeset
28 print *,testCatch
131
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
29 if (sum(testCatch)/=4) STOP 1
111
kono
parents:
diff changeset
30 print *,testObj%test(3,3)
131
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
31 if (sum(testObj%test(3,3))/=9) STOP 2
111
kono
parents:
diff changeset
32 end program bugTest