lto: Remove random_seed from section name.
[official-gcc.git] / gcc / testsuite / gfortran.dg / erf_3.F90
blob2e3d58b445bf9297be801243f5f9ad0f29262c26
1 ! { dg-options "-fno-range-check -ffree-line-length-none -O0" }
2 ! { dg-add-options ieee }
3 ! { dg-skip-if "PR libfortran/59313" { hppa*-*-hpux* } }
5 ! Check that simplification functions and runtime library agree on ERF,
6 ! ERFC and ERFC_SCALED, for quadruple-precision.
9 program test
10   use, intrinsic :: iso_fortran_env
11   implicit none
13   ! QP will be the largest supported real kind, possibly real(kind=16)
14   integer, parameter :: qp = real_kinds(ubound(real_kinds,dim=1))
15   real(kind=qp) :: x
17 #define CHECK(a) \
18   x = a ; \
19   call check(erf(real(a,kind=qp)), erf(x)) ; \
20   call check(erfc(real(a,kind=qp)), erfc(x)) ; \
21   call check(erfc_scaled(real(a,kind=qp)), erfc_scaled(x))
23   CHECK(0.0)
24   CHECK(0.9)
25   CHECK(1.9)
26   CHECK(10.)
27   CHECK(11.)
28   CHECK(12.)
29   CHECK(13.)
30   CHECK(14.)
31   CHECK(49.)
32   CHECK(190.)
34   CHECK(-0.0)
35   CHECK(-0.9)
36   CHECK(-1.9)
37   CHECK(-19.)
38   CHECK(-190.)
40 contains
42   subroutine check (a, b)
43     real(kind=qp), intent(in) :: a, b
44     print *, abs(a-b) / spacing(a)
45     if (abs(a - b) > 10 * spacing(a)) STOP 1
46   end subroutine
48 end program test