2 ! { dg-options "-finit-local-zero -finit-derived -fdump-tree-original" }
4 ! Make sure -finit-derived initializes components of local derived type
5 ! variables to zero with -finit-local-zero.
8 subroutine dummy(i1
,r1
,c1
,l1
,i2
,r2
,c2
,l2
)
10 integer, intent(in
) :: i1
11 real, intent(in
) :: r1
12 character, intent(in
) :: c1
13 logical, intent(in
) :: l1
14 integer, intent(out
) :: i2
15 real, intent(out
) :: r2
16 character, intent(out
) :: c2
17 logical, intent(out
) :: l2
37 call dummy (x
%i1
, x
%r1
, x
%c1
, x
%l1
, x
%y
%i2
, x
%y
%r2
, x
%y
%c2
, x
%y
%l2
)
41 ! We expect to see each component initialized exactly once in MAIN.
42 ! NB. the "once" qualifier also tests that the dummy variables aren't
43 ! given an extraneous initializer.
44 ! { dg-final { scan-tree-dump-times "i1= *0" 1 "original" } }
45 ! { dg-final { scan-tree-dump-times "r1= *0" 1 "original" } }
46 ! { dg-final { scan-tree-dump-times "c1= *\"\"" 1 "original" } }
47 ! { dg-final { scan-tree-dump-times "l1= *0" 1 "original" } }
48 ! { dg-final { scan-tree-dump-times "i2= *0" 1 "original" } }
49 ! { dg-final { scan-tree-dump-times "r2= *0" 1 "original" } }
50 ! { dg-final { scan-tree-dump-times "c2= *\"\"" 1 "original" } }
51 ! { dg-final { scan-tree-dump-times "l2= *0" 1 "original" } }