gcc/testsuite/gfortran.dg/pdt_27.f03
raw| 1 | ! { dg-do run } |
| 2 | ! |
| 3 | ! Test the fix for PR83611, in which the assignment caused a |
| 4 | ! double free error and the initialization of 'foo' was not done. |
| 5 | ! |
| 6 | module pdt_m |
| 7 | implicit none |
| 8 | type :: vec(k) |
| 9 | integer, len :: k=3 |
| 10 | integer :: foo(k)=[1,2,3] |
| 11 | end type vec |
| 12 | end module pdt_m |
| 13 | |
| 14 | program test_pdt |
| 15 | use pdt_m |
| 16 | implicit none |
| 17 | type(vec) :: u,v |
| 18 | if (any (u%foo .ne. [1,2,3])) STOP 1 |
| 19 | u%foo = [7,8,9] |
| 20 | v = u |
| 21 | if (any (v%foo .ne. [7,8,9])) STOP 2 |
| 22 | end program test_pdt |