2 ! Checks the fixes for PR34681 and PR34704, in which various mixtures
\r
3 ! of default initializer and allocatable array were not being handled
\r
4 ! correctly for derived types with allocatable components.
6 ! Contributed by Paolo Giannozzi <p.giannozzi@fisica.uniud.it>
9 integer :: c1, c2, c3, c4, c5
\r
11 call mah (0, c1) ! These calls deal with PR34681
\r
15 if (c1 /= c2) call abort
16 if (c1 /= c3) call abort
\r
18 call mah0 (c4) ! These calls deal with PR34704
\r
21 if (c4 /= c5) call abort
25 subroutine mah (i, c)
\r
27 integer, intent(in) :: i
\r
28 integer, intent(OUT) :: c
\r
31 real(8), allocatable :: a(:)
\r
32 complex(8), allocatable :: b(:)
\r
34 type(mix_type), allocatable, save :: t(:)
\r
35 integer :: j, n=1024
\r
39 allocate (t(1)%a(n))
\r
40 allocate (t(1)%b(n))
\r
46 c = sum( t(1)%a(:) ) + sum( t(1)%b(:) )
\r
56 integer, intent(OUT) :: c
\r
58 real(8), allocatable :: a(:)
\r
72 integer, intent(OUT) :: c
\r
74 real(8), allocatable :: a(:)
\r
77 type(mix_type), save :: t
\r