1 ! { dg-do run { xfail spu-*-* ia64-*-linux* } }
2 ! { dg-options "-fno-range-check -ffree-line-length-none -O0" }
3 ! { dg-add-options ieee }
4 ! { dg-skip-if "PR libfortran/59313" { hppa*-*-hpux* } }
6 ! Check that simplification functions and runtime library agree on ERF,
7 ! ERFC and ERFC_SCALED, for quadruple-precision.
9 ! XFAILed for SPU targets because our library implementation of
10 ! the double-precision erf/erfc functions is not accurate enough.
12 ! XFAILed for IA64 Linux because of a glibc bug:
13 ! http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59227
16 use, intrinsic :: iso_fortran_env
19 ! QP will be the largest supported real kind, possibly real(kind=16)
20 integer, parameter :: qp = real_kinds(ubound(real_kinds,dim=1))
25 call check(erf(real(a,kind=qp)), erf(x)) ; \
26 call check(erfc(real(a,kind=qp)), erfc(x)) ; \
27 call check(erfc_scaled(real(a,kind=qp)), erfc_scaled(x))
48 subroutine check (a, b)
49 real(kind=qp), intent(in) :: a, b
50 print *, abs(a-b) / spacing(a)
51 if (abs(a - b) > 10 * spacing(a)) call abort