3 ! Check the fix for PR34640 comment 28.
5 ! This involves pointer array components that point to components of arrays
9 real, pointer :: rvar(:)
17 type(var_tables
) :: vtab_r
18 type(real_vars
), target
:: x(2)
22 x
= [real_vars (11.0, 1.0), real_vars (42.0, 2.0)]
24 if (any (abs (vtab_r
%rvar
- [11.0, 42.0]) > 1.0e-5)) STOP 1! Check skipping 'index; is OK.
27 if (any (abs (y
- [11.0, 42.0]) > 1.0e-5)) STOP 2! Check that the component is usable in assignment.
29 call foobar (vtab_r
, [11.0, 42.0])
33 call foobar (vtab_r
, [111.0, 142.0])
36 subroutine foobar (vtab
, array
)
37 type(var_tables
) :: vtab
39 if (any (abs (vtab
%rvar
- array
) > 1.0e-5)) STOP 3! Check passing as a dummy.
40 if (abs (vtab
%rvar(2) - array(2)) > 1.0e-5) STOP 4! Check component reference.
43 function barfoo () result(res
)
44 type(var_tables
) :: res
45 allocate (res
%rvar(2), source
= [111.0, 142.0]) ! Check allocation