2017-12-08 Richard Biener <rguenther@suse.de>
[official-gcc.git] / gcc / testsuite / gfortran.dg / derived_pointer_recursion_2.f90
blob75f72d5c1e1ec79d4395dd3d88b54b551c5c11a6
1 ! { dg-do run }
3 ! PR 40594: [4.5 Regression] wrong-code
5 ! Original test case by Daniel Franke <dfranke@gcc.gnu.org>
6 ! Modified by Janus Weil <janus@gcc.gnu.org>
8 MODULE atom_types
10 TYPE :: atom_list
11 TYPE(atom_private), DIMENSION(:), pointer :: table
12 END TYPE
14 TYPE :: atom_private
15 TYPE(atom_list) :: neighbors
16 LOGICAL :: initialized = .true.
17 END TYPE
19 TYPE :: atom_model
20 TYPE(atom_list) :: atoms
21 integer :: dummy
22 END TYPE
24 contains
26 SUBROUTINE init(this)
27 TYPE(atom_private) :: this
28 this%initialized = .FALSE.
29 END SUBROUTINE
31 END MODULE
34 program pr40594
36 USE atom_types
37 TYPE(atom_model) :: am
38 type(atom_private) :: ap
40 am%dummy = 0
42 call init(ap)
43 if (ap%initialized .neqv. .false.) call abort()
45 END