OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [tags/] [gnu-src/] [gcc-4.5.1/] [gcc-4.5.1-or32-1.0rc2/] [gcc/] [testsuite/] [gfortran.dg/] [erf_2.F90] - Blame information for rev 384

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 302 jeremybenn
! { dg-do run }
2
! { dg-options "-fno-range-check -ffree-line-length-none " }
3
! { dg-add-options ieee }
4
!
5
! Check that simplification functions and runtime library agree on ERF,
6
! ERFC and ERFC_SCALED.
7
 
8
program test
9
  implicit none
10
 
11
  interface check
12
    procedure check_r4
13
    procedure check_r8
14
  end interface check
15
 
16
  real(kind=4) :: x4
17
  real(kind=8) :: x8
18
 
19
#define CHECK(a) \
20
  x8 = a ; x4 = a ; \
21
  call check(erf(real(a,kind=8)), erf(x8)) ; \
22
  call check(erf(real(a,kind=4)), erf(x4)) ; \
23
  call check(erfc(real(a,kind=8)), erfc(x8)) ; \
24
  call check(erfc(real(a,kind=4)), erfc(x4)) ; \
25
  call check(erfc_scaled(real(a,kind=8)), erfc_scaled(x8)) ; \
26
  call check(erfc_scaled(real(a,kind=4)), erfc_scaled(x4)) ;
27
 
28
  CHECK(0.0)
29
  CHECK(0.9)
30
  CHECK(1.9)
31
  CHECK(19.)
32
  CHECK(190.)
33
 
34
  CHECK(-0.0)
35
  CHECK(-0.9)
36
  CHECK(-1.9)
37
  CHECK(-19.)
38
  CHECK(-190.)
39
 
40
contains
41
 
42
  subroutine check_r4 (a, b)
43
    real(kind=4), intent(in) :: a, b
44
    if (abs(a - b) > 10 * spacing(a)) call abort
45
  end subroutine
46
 
47
  subroutine check_r8 (a, b)
48
    real(kind=8), intent(in) :: a, b
49
    if (abs(a - b) > 10 * spacing(a)) call abort
50
  end subroutine
51
 
52
end program test

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.