[Patch, fortran] PR24174 real(10) and complex(10) array IO broken.
Janne Blomqvist
jblomqvi@cc.hut.fi
Tue Oct 18 18:00:00 GMT 2005
On Tue, Oct 18, 2005 at 08:05:04AM +0200, FX Coudert wrote:
> I unfortunately don't have time to review this patch, but...
>
> >>! { dg-do run }
>
> You should make this conditionnal on effective target fortran_large_real.
>
> ! { dg-do run }
> ! { dg-require-effective-target fortran_large_real }
>
> >> real(kind=10) :: a,b(2), c
> >> complex(kind=10) :: d, e, f(2)
>
> And then declare those as
>
> integer,parameter :: k = selected_real_kind (precision (0.0_8) + 1)
>
> real(kind=k) :: a,b(2),c
> complex(kind=k) :: d,e,f(2)
Ok, here is an updated testcase.
--
Janne Blomqvist
-------------- next part --------------
! { dg-do run }
! { dg-require-effective-target fortran_large_real }
! PR 24174
program kind10_formatted_io
! This should be kind=10 on systems that support it
integer, parameter :: k = selected_real_kind (precision (0.0_8) + 1)
real(kind=k) :: a,b(2), c
complex(kind=k) :: d, e, f(2)
character(len=180) :: tmp
! Test real(k) scalar and array formatted IO
b(:) = 2.0_k
write (tmp, *) b
read (tmp, *) a, c
if (a /= 2.0_k) call abort()
if (c /= 2.0_k) call abort()
! Complex(k) scalar and array formatted and list formatted IO
f = cmplx ( 1.0_k, 2.0_k, k)
d = cmplx ( huge (1.0_k), huge (2.0_k), k)
write (tmp, *) d
! read (tmp, *) e ! List formatted read doesn't work.
! if (e /= d) call abort()
write (tmp, '(2(e12.4e5, 2x))') d
! read (tmp, '(2(e12.4e5, 2x))') e ! Read doesn't work either
! if (e /= d) call abort()
end program kind10_formatted_io
More information about the Fortran
mailing list