2 ! { dg-require-effective-target fortran_large_real }
3 ! PR 24174 and PR 24305
4 program large_real_kind_form_io_1
5 ! This should be 10 on systems that support kind=10
6 integer, parameter :: k
= selected_real_kind (precision (0.0_8
) + 1)
7 real(kind
=k
) :: a
,b(2), c
, eps
8 complex(kind
=k
) :: d
, e
, f(2), g
9 character(len
=200) :: tmp
10 ! Test real(k) scalar and array formatted IO
11 eps
= 10 * spacing (2.0_k
) ! 10 ulp precision is enough.
15 if (abs (a
- b(1)) > eps
) call abort ()
16 if (abs (c
- b(2)) > eps
) call abort ()
17 ! Complex(k) scalar and array formatted and list formatted IO
18 d
= cmplx ( 1.0_k
, 2.0_k
, k
)
22 if (abs (e
- d
) > eps
) call abort ()
23 if (abs (g
- d
) > eps
) call abort ()
24 write (tmp
, '(2(e12.4e5, 2x))') d
25 read (tmp
, '(2(e12.4e5, 2x))') e
26 if (abs (e
- d
) > eps
) call abort()
27 end program large_real_kind_form_io_1