diff options
author | upstream source tree <ports@midipix.org> | 2015-03-15 20:14:05 -0400 |
---|---|---|
committer | upstream source tree <ports@midipix.org> | 2015-03-15 20:14:05 -0400 |
commit | 554fd8c5195424bdbcabf5de30fdc183aba391bd (patch) | |
tree | 976dc5ab7fddf506dadce60ae936f43f58787092 /gcc/testsuite/gfortran.dg/pr32242.f90 | |
download | cbb-gcc-4.6.4-upstream.tar.bz2 cbb-gcc-4.6.4-upstream.tar.xz |
obtained gcc-4.6.4.tar.bz2 from upstream website;upstream
verified gcc-4.6.4.tar.bz2.sig;
imported gcc-4.6.4 source tree from verified upstream tarball.
downloading a git-generated archive based on the 'upstream' tag
should provide you with a source tree that is binary identical
to the one extracted from the above tarball.
if you have obtained the source via the command 'git clone',
however, do note that line-endings of files in your working
directory might differ from line-endings of the respective
files in the upstream repository.
Diffstat (limited to 'gcc/testsuite/gfortran.dg/pr32242.f90')
-rw-r--r-- | gcc/testsuite/gfortran.dg/pr32242.f90 | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/gcc/testsuite/gfortran.dg/pr32242.f90 b/gcc/testsuite/gfortran.dg/pr32242.f90 new file mode 100644 index 000000000..21ecdd178 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/pr32242.f90 @@ -0,0 +1,40 @@ +!PR fortran/32242 +! { dg-do compile } +! { dg-options "-Wreturn-type" } +! { dg-final { cleanup-modules "kahan_sum" } } + +MODULE kahan_sum + INTEGER, PARAMETER :: dp=KIND(0.0D0) + INTERFACE accurate_sum + MODULE PROCEDURE kahan_sum_d1, kahan_sum_z1 + END INTERFACE accurate_sum + TYPE pw_grid_type + REAL (KIND=dp), DIMENSION ( : ), POINTER :: gsq + END TYPE pw_grid_type + TYPE pw_type + REAL (KIND=dp), DIMENSION ( : ), POINTER :: cr + COMPLEX (KIND=dp), DIMENSION ( : ), POINTER :: cc + TYPE ( pw_grid_type ), POINTER :: pw_grid + END TYPE pw_type +CONTAINS + FUNCTION kahan_sum_d1(array,mask) RESULT(ks) ! { dg-warning "not set" } + REAL(KIND=dp), DIMENSION(:), INTENT(IN) :: array + LOGICAL, DIMENSION(:), INTENT(IN), & + OPTIONAL :: mask + REAL(KIND=dp) :: ks + END FUNCTION kahan_sum_d1 + FUNCTION kahan_sum_z1(array,mask) RESULT(ks) ! { dg-warning "not set" } + COMPLEX(KIND=dp), DIMENSION(:), & + INTENT(IN) :: array + LOGICAL, DIMENSION(:), INTENT(IN), & + OPTIONAL :: mask + COMPLEX(KIND=dp) :: ks + END FUNCTION kahan_sum_z1 + +FUNCTION pw_integral_a2b ( pw1, pw2 ) RESULT ( integral_value ) + TYPE(pw_type), INTENT(IN) :: pw1, pw2 + REAL(KIND=dp) :: integral_value + integral_value = accurate_sum ( REAL ( CONJG ( pw1 % cc ( : ) ) & + * pw2 % cc ( : ) ,KIND=dp) * pw1 % pw_grid % gsq ( : ) ) +END FUNCTION pw_integral_a2b +END MODULE |