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/integer_exponentiation_5.F90 | |
download | cbb-gcc-4.6.4-15d2061ac0796199866debe9ac87130894b0cdd3.tar.bz2 cbb-gcc-4.6.4-15d2061ac0796199866debe9ac87130894b0cdd3.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/integer_exponentiation_5.F90')
-rw-r--r-- | gcc/testsuite/gfortran.dg/integer_exponentiation_5.F90 | 80 |
1 files changed, 80 insertions, 0 deletions
diff --git a/gcc/testsuite/gfortran.dg/integer_exponentiation_5.F90 b/gcc/testsuite/gfortran.dg/integer_exponentiation_5.F90 new file mode 100644 index 000000000..58c7614d5 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/integer_exponentiation_5.F90 @@ -0,0 +1,80 @@ +! { dg-do run { xfail spu-*-* } } +! FAILs on SPU because of invalid result of 1.0/0.0 inline code +! { dg-options "-fno-range-check" } +! { dg-add-options ieee } +module mod_check + implicit none + + interface check + module procedure check_i8 + module procedure check_i4 + module procedure check_r8 + module procedure check_r4 + module procedure check_c8 + module procedure check_c4 + end interface check + +contains + + subroutine check_i8 (a, b) + integer(kind=8), intent(in) :: a, b + if (a /= b) call abort() + end subroutine check_i8 + + subroutine check_i4 (a, b) + integer(kind=4), intent(in) :: a, b + if (a /= b) call abort() + end subroutine check_i4 + + subroutine check_r8 (a, b) + real(kind=8), intent(in) :: a, b + if (a /= b) call abort() + end subroutine check_r8 + + subroutine check_r4 (a, b) + real(kind=4), intent(in) :: a, b + if (a /= b) call abort() + end subroutine check_r4 + + subroutine check_c8 (a, b) + complex(kind=8), intent(in) :: a, b + if (a /= b) call abort() + end subroutine check_c8 + + subroutine check_c4 (a, b) + complex(kind=4), intent(in) :: a, b + if (a /= b) call abort() + end subroutine check_c4 + +end module mod_check + +program test + use mod_check + implicit none + + integer(kind=4) :: i4 + integer(kind=8) :: i8 + real(kind=4) :: r4 + real(kind=8) :: r8 + complex(kind=4) :: c4 + complex(kind=8) :: c8 + +#define TEST(base,exp,var) var = base; call check((var)**(exp),(base)**(exp)) + +!!!!! INTEGER BASE !!!!! + TEST(3,23,i4) + TEST(-3,23,i4) + TEST(3_8,43_8,i8) + TEST(-3_8,43_8,i8) + + TEST(17_8,int(huge(0_4),kind=8)+1,i8) + +!!!!! REAL BASE !!!!! + TEST(0.0,-1,r4) + TEST(0.0,-huge(0)-1,r4) + TEST(2.0,huge(0),r4) + TEST(nearest(1.0,-1.0),-huge(0),r4) + +end program test + +! { dg-final { cleanup-modules "mod_check" } } |