* tree-loop-distribution.c (struct partition): New field recording
[official-gcc.git] / gcc / testsuite / gfortran.dg / erf_2.F90
blobc92f45b047682fdd57b2443ad9bbfc48214d178e
1 ! { dg-do run { xfail spu-*-* } }
2 ! { dg-options "-fno-range-check -ffree-line-length-none -O0" }
3 ! { dg-add-options ieee }
5 ! XFAILed for SPU targets because our library implementation of
6 ! the double-precision erf/erfc functions is not accurate enough.
8 ! Check that simplification functions and runtime library agree on ERF,
9 ! ERFC and ERFC_SCALED.
11 program test
12   implicit none
14   interface check
15     procedure check_r4
16     procedure check_r8
17   end interface check
19   real(kind=4) :: x4
20   real(kind=8) :: x8
22 #define CHECK(a) \
23   x8 = a ; x4 = a ; \
24   call check(erf(real(a,kind=8)), erf(x8)) ; \
25   call check(erf(real(a,kind=4)), erf(x4)) ; \
26   call check(erfc(real(a,kind=8)), erfc(x8)) ; \
27   call check(erfc(real(a,kind=4)), erfc(x4)) ; \
28   call check(erfc_scaled(real(a,kind=8)), erfc_scaled(x8)) ; \
29   call check(erfc_scaled(real(a,kind=4)), erfc_scaled(x4)) ;
31   CHECK(0.0)
32   CHECK(0.9)
33   CHECK(1.9)
34   CHECK(19.)
35   CHECK(190.)
37   CHECK(-0.0)
38   CHECK(-0.9)
39   CHECK(-1.9)
40   CHECK(-19.)
41   CHECK(-190.)
43 contains
45   subroutine check_r4 (a, b)
46     real(kind=4), intent(in) :: a, b
47     if (abs(a - b) > 10 * spacing(a)) call abort
48   end subroutine
50   subroutine check_r8 (a, b)
51     real(kind=8), intent(in) :: a, b
52     if (abs(a - b) > 10 * spacing(a)) call abort
53   end subroutine
55 end program test