2008-07-06 Kai Tietz <kai.tietz@onevision.com>
[official-gcc.git] / gcc / testsuite / gfortran.dg / init_flag_3.f90
blob7d6ab33cfc41f63d7c808eeac6b6f6b26b4855ea
1 ! { dg-do run }
2 ! { dg-options "-finit-integer=-1 -finit-logical=false -finit-real=nan" }
3 ! { dg-options "-mieee -finit-integer=-1 -finit-logical=false -finit-real=nan" { target sh*-*-* } }
5 program init_flag_3
6 call real_test
7 call logical_test
8 call int_test
9 call complex_test
10 end program init_flag_3
12 ! Test some initializations for both implicitly and
13 ! explicitly declared local variables.
14 subroutine real_test
15 real r1
16 real r2(10)
17 dimension r3(10,10)
18 if (r1 .eq. r1) call abort
19 if (r2(2) .eq. r2(2)) call abort
20 if (r3(5,5) .eq. r3(5,5)) call abort
21 if (r4 .eq. r4) call abort
22 end subroutine real_test
24 subroutine logical_test
25 logical l1
26 logical l2(2)
27 if (l1 .neqv. .false.) call abort
28 if (l2(2) .neqv. .false.) call abort
29 end subroutine logical_test
31 subroutine int_test
32 integer i1
33 integer i2(10)
34 dimension i3(10,10)
35 if (i1 /= -1) call abort
36 if (i2(2) /= -1) call abort
37 if (i3(5,5) /= -1) call abort
38 if (i4 /= -1) call abort
39 end subroutine int_test
41 subroutine complex_test
42 complex c1
43 complex c2(20,20)
44 if (c1 .eq. c1) call abort
45 if (c2(1,1) .eq. c2(1,1)) call abort
46 end subroutine complex_test