From 6412ecdc939b8abdc3c713a83b38928b3567b2ce Mon Sep 17 00:00:00 2001 From: Jerry DeLisle Date: Thu, 24 Apr 2008 03:55:05 +0000 Subject: [PATCH] re PR fortran/35994 (MAXLOC and MINLOC off by one with mask) 2008-04-23 Jerry DeLisle PR fortran/35994 * gfortran.dg/minmaxloc_5.f90: New test. * gfortran.dg/minmaxloc_6.f90: New test. From-SVN: r134616 --- gcc/testsuite/ChangeLog | 6 ++++++ gcc/testsuite/gfortran.dg/minmaxloc_5.f90 | 18 ++++++++++++++++++ gcc/testsuite/gfortran.dg/minmaxloc_6.f90 | 11 +++++++++++ 3 files changed, 35 insertions(+) create mode 100644 gcc/testsuite/gfortran.dg/minmaxloc_5.f90 create mode 100644 gcc/testsuite/gfortran.dg/minmaxloc_6.f90 diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index b03b011b3a1..b73ce752a8b 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,9 @@ +2008-04-23 Jerry DeLisle + + PR fortran/35994 + * gfortran.dg/minmaxloc_5.f90: New test. + * gfortran.dg/minmaxloc_6.f90: New test. + 2008-04-23 Steve Ellcey * gcc.dg/array-init-1.c: Add big-endian number to check. diff --git a/gcc/testsuite/gfortran.dg/minmaxloc_5.f90 b/gcc/testsuite/gfortran.dg/minmaxloc_5.f90 new file mode 100644 index 00000000000..92e2103dedf --- /dev/null +++ b/gcc/testsuite/gfortran.dg/minmaxloc_5.f90 @@ -0,0 +1,18 @@ +! { dg-do run } +! PR35994 [4.3/4.4 regression] MAXLOC and MINLOC off by one with mask +program GA4076 + REAL DDA(100) + dda = (/(J1,J1=1,100)/) + IDS = MAXLOC(DDA,1) + if (ids.ne.100) call abort !expect 100 + + IDS = MAXLOC(DDA,1, (/(J1,J1=1,100)/) > 50) + if (ids.ne.100) call abort !expect 100 + + IDS = minLOC(DDA,1) + if (ids.ne.1) call abort !expect 1 + + IDS = MinLOC(DDA,1, (/(J1,J1=1,100)/) > 50) + if (ids.ne.51) call abort !expect 51 + +END diff --git a/gcc/testsuite/gfortran.dg/minmaxloc_6.f90 b/gcc/testsuite/gfortran.dg/minmaxloc_6.f90 new file mode 100644 index 00000000000..c61fab47edf --- /dev/null +++ b/gcc/testsuite/gfortran.dg/minmaxloc_6.f90 @@ -0,0 +1,11 @@ +! { dg-do run } +! PR35994 [4.3/4.4 regression] MAXLOC and MINLOC off by one with mask + REAL DDA(5:104) + dda = (/(J1,J1=1,100)/) + + IDS = MAXLOC(DDA,1) + if (ids.ne.100) call abort !expect 100 + IDS = MAXLOC(DDA,1, (/(J1,J1=1,100)/) > 50) + if (ids.ne.100) call abort !expect 100 + + END -- 2.30.2