1! { dg-do run } 2! { dg-options "-finit-integer=1 -finit-logical=true -finit-real=zero" } 3 4program init_flag_2 5 call real_test 6 call logical_test 7 call int_test 8 call complex_test 9end program init_flag_2 10 11! Test some initializations for both implicitly and 12! explicitly declared local variables. 13subroutine real_test 14 real r1 15 real r2(10) 16 dimension r3(10,10) 17 if (r1 /= 0.0) call abort 18 if (r2(2) /= 0.0) call abort 19 if (r3(5,5) /= 0.0) call abort 20 if (r4 /= 0.0) call abort 21end subroutine real_test 22 23subroutine logical_test 24 logical l1 25 logical l2(2) 26 if (l1 .neqv. .true.) call abort 27 if (l2(2) .neqv. .true.) call abort 28end subroutine logical_test 29 30subroutine int_test 31 integer i1 32 integer i2(10) 33 dimension i3(10,10) 34 if (i1 /= 1) call abort 35 if (i2(2) /= 1) call abort 36 if (i3(5,5) /= 1) call abort 37 if (i4 /= 1) call abort 38end subroutine int_test 39 40subroutine complex_test 41 complex c1 42 complex c2(20,20) 43 if (c1 /= (0.0,0.0)) call abort 44 if (c2(1,1) /= (0.0,0.0)) call abort 45end subroutine complex_test 46