hppa64: Fix fmt_f_default_field_width_3.f90 and fmt_g_default_field_width_3.f90
[official-gcc.git] / gcc / testsuite / gfortran.dg / init_flag_14.f90
blob13991f826d75b60620068014b63352c5dd7ce239
1 ! { dg-do compile }
2 ! { dg-options "-finit-derived -finit-integer=42 -finit-real=inf -finit-logical=true -finit-character=32 -fdump-tree-original" }
4 ! Make sure -finit-derived initializes components of local derived type
5 ! variables according to other -finit-* flags.
8 subroutine dummy(i1,r1,c1,l1,i2,r2,c2,l2)
9 implicit none
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
18 end subroutine
20 type t2
21 integer i2
22 real r2
23 character c2
24 logical l2
25 end type
27 type t1
28 logical l1
29 real r1
30 character c1
31 integer i1
32 type (t2) y
33 end type
35 type (t1) :: x
37 call dummy (x%i1, x%r1, x%c1, x%l1, x%y%i2, x%y%r2, x%y%c2, x%y%l2)
39 end
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= *42" 1 "original" } }
45 ! { dg-final { scan-tree-dump-times "r1= *\[iI]nf" 1 "original" } }
46 ! { dg-final { scan-tree-dump-times "c1= *\" \"" 1 "original" } }
47 ! { dg-final { scan-tree-dump-times "l1= *1" 1 "original" } }
48 ! { dg-final { scan-tree-dump-times "i2= *42" 1 "original" } }
49 ! { dg-final { scan-tree-dump-times "r2= *\[iI]nf" 1 "original" } }
50 ! { dg-final { scan-tree-dump-times "c2= *\" \"" 1 "original" } }
51 ! { dg-final { scan-tree-dump-times "l2= *1" 1 "original" } }