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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [gfortran.dg/] [pr32242.f90] - Blame information for rev 848

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 694 jeremybenn
!PR fortran/32242
2
! { dg-do compile }
3
! { dg-options "-Wreturn-type" }
4
! { dg-final { cleanup-modules "kahan_sum" } }
5
 
6
MODULE kahan_sum
7
  INTEGER, PARAMETER :: dp=KIND(0.0D0)
8
  INTERFACE accurate_sum
9
    MODULE PROCEDURE kahan_sum_d1, kahan_sum_z1
10
  END INTERFACE accurate_sum
11
  TYPE pw_grid_type
12
     REAL (KIND=dp), DIMENSION ( : ), POINTER :: gsq
13
  END TYPE pw_grid_type
14
  TYPE pw_type
15
     REAL (KIND=dp), DIMENSION ( : ), POINTER :: cr
16
     COMPLEX (KIND=dp), DIMENSION ( : ), POINTER :: cc
17
     TYPE ( pw_grid_type ), POINTER :: pw_grid
18
  END TYPE pw_type
19
CONTAINS
20
 FUNCTION kahan_sum_d1(array,mask) RESULT(ks)         ! { dg-warning "not set" }
21
   REAL(KIND=dp), DIMENSION(:), INTENT(IN)  :: array
22
   LOGICAL, DIMENSION(:), INTENT(IN), &
23
     OPTIONAL                               :: mask
24
   REAL(KIND=dp)                            :: ks
25
 END FUNCTION kahan_sum_d1
26
  FUNCTION kahan_sum_z1(array,mask) RESULT(ks)        ! { dg-warning "not set" }
27
    COMPLEX(KIND=dp), DIMENSION(:), &
28
      INTENT(IN)                             :: array
29
    LOGICAL, DIMENSION(:), INTENT(IN), &
30
      OPTIONAL                               :: mask
31
    COMPLEX(KIND=dp)                         :: ks
32
  END FUNCTION kahan_sum_z1
33
 
34
FUNCTION pw_integral_a2b ( pw1, pw2 ) RESULT ( integral_value )
35
    TYPE(pw_type), INTENT(IN)                :: pw1, pw2
36
    REAL(KIND=dp)                            :: integral_value
37
     integral_value = accurate_sum ( REAL ( CONJG ( pw1 % cc ( : ) ) &
38
          *  pw2 % cc ( : ) ,KIND=dp) * pw1 % pw_grid % gsq ( : ) )
39
END FUNCTION pw_integral_a2b
40
END MODULE

powered by: WebSVN 2.1.0

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