Debian Codegraph @

gcc/testsuite/gfortran.dg/init_flag_18.f90

raw
1 ! { dg-do compile }
2 ! { dg-options "-finit-derived" }
3 !
4 ! PR fortran/83183
5 !
6 ! Test a regression where -finit-derived recursed infinitely generating
7 ! initializers for allocatable components of the same derived type.
8 !
9
10 program pr83183
11 type :: linked_list
12 type(linked_list), allocatable :: link
13 integer :: value
14 end type
15 type(linked_list) :: test
16 allocate(test % link)
17 print *, test%value
18 print *, test%link%value
19 end program