diff options
author | Tobias Schlüter <tobias.schlueter@physik.uni-muenchen.de> | 2004-08-22 14:12:04 +0200 |
---|---|---|
committer | Tobias Schlüter <tobi@gcc.gnu.org> | 2004-08-22 14:12:04 +0200 |
commit | c6b77e6f977bacf45097af1336c8e914db13d0d9 (patch) | |
tree | 52627df8ec3e3b3baf71df39244c831d98ff68fa | |
parent | 617097a3374140b8ec5a4e991ff69fbe94329b74 (diff) | |
download | gcc-c6b77e6f977bacf45097af1336c8e914db13d0d9.zip gcc-c6b77e6f977bacf45097af1336c8e914db13d0d9.tar.gz gcc-c6b77e6f977bacf45097af1336c8e914db13d0d9.tar.bz2 |
* gfortran.dg/reduction.f90: Add checks with complex arguments.
From-SVN: r86378
-rw-r--r-- | gcc/testsuite/ChangeLog | 4 | ||||
-rw-r--r-- | gcc/testsuite/gfortran.dg/reduction.f90 | 27 |
2 files changed, 31 insertions, 0 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index de614af..0bf7dfb 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,7 @@ +2004-08-22 Tobias Schlueter <tobias.schlueter@physik.uni-muenchen.de> + + * gfortran.dg/reduction.f90: Add checks with complex arguments. + 2004-08-21 Bud Davis <bdavis9659@comcast.net> PR 16908 diff --git a/gcc/testsuite/gfortran.dg/reduction.f90 b/gcc/testsuite/gfortran.dg/reduction.f90 index f98eb29..8219354 100644 --- a/gcc/testsuite/gfortran.dg/reduction.f90 +++ b/gcc/testsuite/gfortran.dg/reduction.f90 @@ -9,6 +9,7 @@ program reduction_mask integer, parameter :: res(4*9) = (/ 3, 3, 3, 2, 2, 2, 2, 2, 2, 1, 1, 1, 1, & 1, 1, 1, 1, 1, 6, 6, 6, 2, 2, 2, 2, 2, 2, 6, 6, 6, 3, 3, 3, 3, 3, 3 /) integer :: val(4*9) + complex :: cval(2*9), cin(3) equal = (/ .true., .true., .false. /) @@ -55,4 +56,30 @@ program reduction_mask val(36) = sum((/ 1, 2, 3 /), mask=equal, dim=1) if (any (val /= res)) call abort + + ! Tests for complex arguments. These were broken by the original fix. + + cin = cmplx((/1,2,3/)) + + cval(1) = product(cin) + cval(2) = product(cin, 1) + cval(3) = product(cin, dim=1) + cval(4) = product(cin, equal) + cval(5) = product(cin, mask=equal) + cval(6) = product(cin, 1, equal) + cval(7) = product(cin, 1, mask=equal) + cval(8) = product(cin, dim=1, mask=equal) + cval(9) = product(cin, mask=equal, dim=1) + + cval(10) = sum(cin) + cval(11) = sum(cin, 1) + cval(12) = sum(cin, dim=1) + cval(13) = sum(cin, equal) + cval(14) = sum(cin, mask=equal) + cval(15) = sum(cin, 1, equal) + cval(16) = sum(cin, 1, mask=equal) + cval(17) = sum(cin, dim=1, mask=equal) + cval(18) = sum(cin, mask=equal, dim=1) + + if (any (cval /= cmplx(res(19:36)))) call abort end program reduction_mask |