aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorThomas Koenig <Thomas.Koenig@online.de>2005-07-07 22:01:41 +0000
committerThomas Koenig <tkoenig@gcc.gnu.org>2005-07-07 22:01:41 +0000
commit47b3a403a5b5424d15829d47abd4cb1a8a87e93e (patch)
tree6e619479081b13e187d8cae04afbb290a97762a8 /gcc
parent5a29b385acaae4c85403081e38ce0876ae423524 (diff)
downloadgcc-47b3a403a5b5424d15829d47abd4cb1a8a87e93e.zip
gcc-47b3a403a5b5424d15829d47abd4cb1a8a87e93e.tar.gz
gcc-47b3a403a5b5424d15829d47abd4cb1a8a87e93e.tar.bz2
re PR fortran/21594 ([4.0 only] FAIL: gfortran.dg/eoshift.f90 -O0 execution test)
2005-07-07 Thomas Koenig <Thomas.Koenig@online.de> PR libfortran/21594 * intrinsics/eoshift0.c: If abs(shift) > len, fill the the whole array with the boundary value, but don't overrun it. * intrinsics/eoshift2.c: Likewise. * m4/eoshift1.m4: Likewise. * m4/eoshift3.m4: Likewise. * generated/eoshift1_4.c: Regenerated. * generated/eoshift1_8.c: Regenerated. * generated/eoshift3_4.c: Regenerated. * generated/eoshift3_8.c: Regenerated. 2005-07-07 Thomas Koenig <Thomas.Koenig@online.de> PR libfortran/21594 * gfortran.fortran-torture/execute/intrinsic_eoshift.f90: Add test cases where the shift length is greater than the array length. From-SVN: r101738
Diffstat (limited to 'gcc')
-rw-r--r--gcc/testsuite/ChangeLog7
-rw-r--r--gcc/testsuite/gfortran.fortran-torture/execute/intrinsic_eoshift.f9028
2 files changed, 35 insertions, 0 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 29ed4af..1804874 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,10 @@
+2005-07-07 Thomas Koenig <Thomas.Koenig@online.de>
+
+ PR libfortran/21594
+ * gfortran.fortran-torture/execute/intrinsic_eoshift.f90:
+ Add test cases where the shift length is greater than the
+ array length.
+
2005-07-07 Ziemowit Laski <zlaski@apple.com>
* obj-c++.dg/gnu-runtime-2.mm: Compile, do not run.
diff --git a/gcc/testsuite/gfortran.fortran-torture/execute/intrinsic_eoshift.f90 b/gcc/testsuite/gfortran.fortran-torture/execute/intrinsic_eoshift.f90
index 872422d..c4bbcdd 100644
--- a/gcc/testsuite/gfortran.fortran-torture/execute/intrinsic_eoshift.f90
+++ b/gcc/testsuite/gfortran.fortran-torture/execute/intrinsic_eoshift.f90
@@ -11,10 +11,18 @@ program intrinsic_eoshift
call abort
a = reshape ((/1, 2, 3, 4, 5, 6, 7, 8, 9/), (/3, 3/))
+ a = eoshift (a, 9999, 99, 1)
+ if (any (a .ne. 99)) call abort
+
+ a = reshape ((/1, 2, 3, 4, 5, 6, 7, 8, 9/), (/3, 3/))
a = eoshift (a, -2, dim = 2)
if (any (a .ne. reshape ((/0, 0, 0, 0, 0, 0, 1, 2, 3/), (/3, 3/)))) &
call abort
+ a = reshape ((/1, 2, 3, 4, 5, 6, 7, 8, 9/), (/3, 3/))
+ a = eoshift (a, -9999, 99, 1)
+ if (any (a .ne. 99)) call abort
+
! Array shift and scalar bound.
a = reshape ((/1, 2, 3, 4, 5, 6, 7, 8, 9/), (/3, 3/))
a = eoshift (a, (/1, 0, -1/), 99, 1)
@@ -22,6 +30,11 @@ program intrinsic_eoshift
call abort
a = reshape ((/1, 2, 3, 4, 5, 6, 7, 8, 9/), (/3, 3/))
+ a = eoshift (a, (/9999, 0, -9999/), 99, 1)
+ if (any (a .ne. reshape ((/99, 99, 99, 4, 5, 6, 99, 99, 99/), (/3, 3/)))) &
+ call abort
+
+ a = reshape ((/1, 2, 3, 4, 5, 6, 7, 8, 9/), (/3, 3/))
a = eoshift (a, (/2, -2, 0/), dim = 2)
if (any (a .ne. reshape ((/7, 0, 3, 0, 0, 6, 0, 2, 9/), (/3, 3/)))) &
call abort
@@ -33,6 +46,16 @@ program intrinsic_eoshift
call abort
a = reshape ((/1, 2, 3, 4, 5, 6, 7, 8, 9/), (/3, 3/))
+ a = eoshift (a, 9999, (/99, -1, 42/), 1)
+ if (any (a .ne. reshape ((/99, 99, 99, -1, -1, -1, 42, 42, 42/), &
+ (/3, 3/)))) call abort
+
+ a = reshape ((/1, 2, 3, 4, 5, 6, 7, 8, 9/), (/3, 3/))
+ a = eoshift (a, -9999, (/99, -1, 42/), 1)
+ if (any (a .ne. reshape ((/99, 99, 99, -1, -1, -1, 42, 42, 42/), &
+ (/3, 3/)))) call abort
+
+ a = reshape ((/1, 2, 3, 4, 5, 6, 7, 8, 9/), (/3, 3/))
a = eoshift (a, -2, (/99, -1, 42/), 2)
if (any (a .ne. reshape ((/99, -1, 42, 99, -1, 42, 1, 2, 3/), (/3, 3/)))) &
call abort
@@ -61,6 +84,11 @@ program intrinsic_eoshift
if (any (a .ne. reshape ((/ -999, -999, -999, -99, 4, 5, -9, -9, -9 /), &
shape(a)))) call abort
+ a = reshape ((/1, 2, 3, 4, 5, 6, 7, 8, 9/), (/3, 3/))
+ a = eoshift (a, (/9999, -9999, 0/), (/99, -1, 42/), 2)
+ if (any (a .ne. reshape ((/99, -1, 3, 99, -1, 6, 99, -1, 9/), (/3, 3/)))) &
+ call abort
+
! Test arrays > rank 2
b(:, :, 1) = reshape ((/1, 2, 3, 4, 5, 6, 7, 8, 9/), (/3, 3/))
b(:, :, 2) = 10 + reshape ((/1, 2, 3, 4, 5, 6, 7, 8, 9/), (/3, 3/))