PR tree-optimization/86415 - strlen() not folded for substrings within constant arrays
[official-gcc.git] / gcc / testsuite / gfortran.dg / init_flag_10.f90
blob64782456f43b9d7ef101b3e9d9bd48254fcd83ac
1 ! { dg-do run }
2 ! { dg-options "-finit-real=NAN" }
3 ! { dg-add-options ieee }
4 ! { dg-skip-if "NaN not supported" { spu-*-* } }
6 ! PR fortran/50619
8 ! Contributed by Fred Krogh
10 ! The NaN initialization used to set the associate name to NaN!
13 module testa2
14 type, public :: test_ty
15 real :: rmult = 1.0e0
16 end type test_ty
18 contains
19 subroutine test(e, var1)
20 type(test_ty) :: e
21 real :: var1, var2 ! Should get NaN initialized
23 ! Should be the default value
24 if (e%rmult /= 1.0) STOP 1
26 ! Check that NaN initialization is really turned on
27 if (var1 == var1) STOP 2
28 if (var2 == var2) STOP 3
30 ! The following was failing:
31 associate (rmult=>e%rmult)
32 if (e%rmult /= 1.0) STOP 4
33 end associate
34 end subroutine test
35 end module testa2
37 program testa1
38 use testa2
39 type(test_ty) :: e
40 real :: var1 ! Should get NaN initialized
41 call test(e, var1)
42 stop
43 end program testa1