hppa64: Fix fmt_f_default_field_width_3.f90 and fmt_g_default_field_width_3.f90
[official-gcc.git] / gcc / testsuite / gfortran.dg / class_allocate_13.f90
blobb527aea7c5e7a6d742f66ef873c65bbd626e0111
1 ! { dg-do run }
3 ! PR 54784: [4.7/4.8 Regression] [OOP] wrong code in polymorphic allocation with SOURCE
5 ! Contributed by Jeremy Kozdon <jkozdon@gmail.com>
7 program bug
8 implicit none
10 type :: block
11 real, allocatable :: fields
12 end type
14 type :: list
15 class(block),allocatable :: B
16 end type
18 type :: domain
19 type(list),dimension(2) :: L
20 end type
22 type(domain) :: d
23 type(block) :: b1
25 allocate(b1%fields,source=5.)
27 allocate(d%L(2)%B,source=b1) ! wrong code
29 if (d%L(2)%B%fields/=5.) STOP 1
31 end program