Remove old autovect-branch by moving to "dead" directory.
[official-gcc.git] / old-autovect-branch / gcc / testsuite / gfortran.dg / large_real_kind_form_io_1.f90
blobc6fb76b7d1069c6073c2ace660345cbddbe053b9
1 ! { dg-do run }
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=180) :: tmp
10 ! Test real(k) scalar and array formatted IO
11 eps = 10 * spacing (2.0_k) ! 10 ulp precision is enough.
12 b(:) = 2.0_k
13 write (tmp, *) b
14 read (tmp, *) a, c
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)
19 f = d
20 write (tmp, *) f
21 read (tmp, *) e, g
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