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

Subversion Repositories openrisc_me

[/] [openrisc/] [trunk/] [gnu-src/] [gcc-4.5.1/] [gcc/] [testsuite/] [gfortran.dg/] [g77/] [intrinsic-unix-bessel.f] - Blame information for rev 302

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 302 jeremybenn
c { dg-do run }
2
c  intrinsic-unix-bessel.f
3
c
4
c Test Bessel function intrinsics.  
5
c These functions are only available if provided by system
6
c
7
c     David Billinghurst <David.Billinghurst@riotinto.com>
8
c
9
      real x, a
10
      double precision dx, da
11
      integer i
12
      integer(kind=2) j
13
      integer(kind=1) k
14
      integer(kind=8) m
15
      logical fail
16
      common /flags/ fail
17
      fail = .false.
18
 
19
      x = 2.0
20
      dx = x
21
      i = 2
22
      j = i
23
      k = i
24
      m = i
25
c     BESJ0  - Bessel function of first kind of order zero
26
      a = 0.22389077
27
      da = a
28
      call c_r(BESJ0(x),a,'BESJ0(real)')
29
      call c_d(BESJ0(dx),da,'BESJ0(double)')
30
      call c_d(DBESJ0(dx),da,'DBESJ0(double)')
31
 
32
c     BESJ1  - Bessel function of first kind of order one
33
      a = 0.57672480
34
      da = a
35
      call c_r(BESJ1(x),a,'BESJ1(real)')
36
      call c_d(BESJ1(dx),da,'BESJ1(double)')
37
      call c_d(DBESJ1(dx),da,'DBESJ1(double)')
38
 
39
c     BESJN  - Bessel function of first kind of order N
40
      a = 0.3528340
41
      da = a
42
      call c_r(BESJN(i,x),a,'BESJN(integer,real)')
43
      call c_r(BESJN(j,x),a,'BESJN(integer(2),real)')
44
      call c_r(BESJN(k,x),a,'BESJN(integer(1),real)')
45
      call c_d(BESJN(i,dx),da,'BESJN(integer,double)')
46
      call c_d(BESJN(j,dx),da,'BESJN(integer(2),double)')
47
      call c_d(BESJN(k,dx),da,'BESJN(integer(1),double)')
48
      call c_d(DBESJN(i,dx),da,'DBESJN(integer,double)')
49
      call c_d(DBESJN(j,dx),da,'DBESJN(integer(2),double)')
50
      call c_d(DBESJN(k,dx),da,'DBESJN(integer(1),double)')
51
 
52
c     BESY0  - Bessel function of second kind of order zero
53
      a = 0.51037567
54
      da = a
55
      call c_r(BESY0(x),a,'BESY0(real)')
56
      call c_d(BESY0(dx),da,'BESY0(double)')
57
      call c_d(DBESY0(dx),da,'DBESY0(double)')
58
 
59
c     BESY1  - Bessel function of second kind of order one
60
      a = 0.-0.1070324
61
      da = a
62
      call c_r(BESY1(x),a,'BESY1(real)')
63
      call c_d(BESY1(dx),da,'BESY1(double)')
64
      call c_d(DBESY1(dx),da,'DBESY1(double)')
65
 
66
c     BESYN  - Bessel function of second kind of order N
67
      a = -0.6174081
68
      da = a
69
      call c_r(BESYN(i,x),a,'BESYN(integer,real)')
70
      call c_r(BESYN(j,x),a,'BESYN(integer(2),real)')
71
      call c_r(BESYN(k,x),a,'BESYN(integer(1),real)')
72
      call c_d(BESYN(i,dx),da,'BESYN(integer,double)')
73
      call c_d(BESYN(j,dx),da,'BESYN(integer(2),double)')
74
      call c_d(BESYN(k,dx),da,'BESYN(integer(1),double)')
75
      call c_d(DBESYN(i,dx),da,'DBESYN(integer,double)')
76
      call c_d(DBESYN(j,dx),da,'DBESYN(integer(2),double)')
77
      call c_d(DBESYN(k,dx),da,'DBESYN(integer(1),double)')
78
 
79
      if ( fail ) call abort()
80
      end
81
 
82
      subroutine failure(label)
83
c     Report failure and set flag
84
      character*(*) label
85
      logical fail
86
      common /flags/ fail
87
      write(6,'(a,a,a)') 'Test ',label,' FAILED'
88
      fail = .true.
89
      end
90
 
91
      subroutine c_r(a,b,label)
92
c     Check if REAL a equals b, and fail otherwise
93
      real a, b
94
      character*(*) label
95
      if ( abs(a-b) .gt. 1.0e-5 ) then
96
         call failure(label)
97
         write(6,*) 'Got ',a,' expected ', b
98
      end if
99
      end
100
 
101
      subroutine c_d(a,b,label)
102
c     Check if DOUBLE PRECISION a equals b, and fail otherwise
103
      double precision a, b
104
      character*(*) label
105
      if ( abs(a-b) .gt. 1.0d-5 ) then
106
         call failure(label)
107
         write(6,*) 'Got ',a,' expected ', b
108
      end if
109
      end

powered by: WebSVN 2.1.0

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