annotate gcc/testsuite/gfortran.dg/func_assign_3.f90 @ 158:494b0b89df80 default tip

...
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Mon, 25 May 2020 18:13:55 +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 ! Tests the fix for PR40646 in which the assignment would cause an ICE.
kono
parents:
diff changeset
3 !
kono
parents:
diff changeset
4 ! Contributed by Charlie Sharpsteen <chuck@sharpsteen.net>
kono
parents:
diff changeset
5 ! http://gcc.gnu.org/ml/fortran/2009-07/msg00010.html
kono
parents:
diff changeset
6 ! and reported by Tobias Burnus <burnus@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 contains
kono
parents:
diff changeset
12 procedure, nopass:: test => returnMat
kono
parents:
diff changeset
13 end type boundTest
kono
parents:
diff changeset
14 contains
kono
parents:
diff changeset
15 function returnMat( a, b ) result( mat )
kono
parents:
diff changeset
16 integer:: a, b, i
kono
parents:
diff changeset
17 double precision, dimension(a,b):: mat
kono
parents:
diff changeset
18 mat = dble (reshape ([(i, i = 1, a * b)],[a,b]))
kono
parents:
diff changeset
19 return
kono
parents:
diff changeset
20 end function returnMat
kono
parents:
diff changeset
21 end module bugTestMod
kono
parents:
diff changeset
22
kono
parents:
diff changeset
23 program bugTest
kono
parents:
diff changeset
24 use bugTestMod
kono
parents:
diff changeset
25 implicit none
kono
parents:
diff changeset
26 integer i
kono
parents:
diff changeset
27 double precision, dimension(2,2):: testCatch
kono
parents:
diff changeset
28 type( boundTest ):: testObj
kono
parents:
diff changeset
29 testCatch = testObj%test(2,2) ! This would cause an ICE
131
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
30 if (any (testCatch .ne. dble (reshape ([(i, i = 1, 4)],[2,2])))) STOP 1
111
kono
parents:
diff changeset
31 end program bugTest