From c6b77e6f977bacf45097af1336c8e914db13d0d9 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Tobias=20Schl=C3=BCter?= Date: Sun, 22 Aug 2004 14:12:04 +0200 Subject: [PATCH] * gfortran.dg/reduction.f90: Add checks with complex arguments. From-SVN: r86378 --- gcc/testsuite/ChangeLog | 4 ++++ gcc/testsuite/gfortran.dg/reduction.f90 | 27 +++++++++++++++++++++++++ 2 files changed, 31 insertions(+) diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index de614afc6de..0bf7dfb0af5 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,7 @@ +2004-08-22 Tobias Schlueter + + * gfortran.dg/reduction.f90: Add checks with complex arguments. + 2004-08-21 Bud Davis PR 16908 diff --git a/gcc/testsuite/gfortran.dg/reduction.f90 b/gcc/testsuite/gfortran.dg/reduction.f90 index f98eb29231f..82193542ff8 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 -- 2.30.2