aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorThomas Koenig <Thomas.Koenig@online.de>2005-04-15 20:06:17 +0000
committerThomas Koenig <tkoenig@gcc.gnu.org>2005-04-15 20:06:17 +0000
commit8e6d7b8a35bdb1f089e83ac8f6a85253e4272c86 (patch)
tree292cf804ca180a2bbd8b572c18603d0233efe047 /gcc
parent35205e8f059ddcbf7a5ce1865901a56d1771b923 (diff)
downloadgcc-8e6d7b8a35bdb1f089e83ac8f6a85253e4272c86.zip
gcc-8e6d7b8a35bdb1f089e83ac8f6a85253e4272c86.tar.gz
gcc-8e6d7b8a35bdb1f089e83ac8f6a85253e4272c86.tar.bz2
re PR libfortran/18495 ([4.0 only] Intrinisc function SPREAD is broken)
2005-04-15 Thomas Koenig <Thomas.Koenig@online.de> PR libfortran/18495 * intrinsics/spread_generic.c (spread): Remove const from return array descriptor. New variables: rrank (rank of return array), rs (for calculating the size of the return array), srank (rank of the source array). Generate runtime error if the dim= argument is larger than the rank of the return array. Generate runtime error if the needed rank of the return array is larger than 7. If ret->data is null, populate the return array descriptor and initialize the variables for the actual operation. Otherwise, set ret->dim[0].stride to one if it is zero. Change second, independent use of variable dim to srank. 2005-04-15 Thomas Koenig <Thomas.Koenig@online.de> PR libfortran/18495 * gfortran.fortran-torture/execute/intrinsic_spread.f90: Test callee-allocated version of return array with a write statement. Test spread with a temporary with another write statement. From-SVN: r98208
Diffstat (limited to 'gcc')
-rw-r--r--gcc/testsuite/ChangeLog8
-rw-r--r--gcc/testsuite/gfortran.fortran-torture/execute/intrinsic_spread.f907
2 files changed, 15 insertions, 0 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 41a3508..594aae1 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,11 @@
+2005-04-15 Thomas Koenig <Thomas.Koenig@online.de>
+
+ PR libfortran/18495
+ * gfortran.fortran-torture/execute/intrinsic_spread.f90:
+ Test callee-allocated version of return array with a write
+ statement.
+ Test spread with a temporary with another write statement.
+
2005-04-15 Kazu Hirata <kazu@cs.umass.edu>
PR tree-optimization/21031
diff --git a/gcc/testsuite/gfortran.fortran-torture/execute/intrinsic_spread.f90 b/gcc/testsuite/gfortran.fortran-torture/execute/intrinsic_spread.f90
index 50b66ff..2308a1d 100644
--- a/gcc/testsuite/gfortran.fortran-torture/execute/intrinsic_spread.f90
+++ b/gcc/testsuite/gfortran.fortran-torture/execute/intrinsic_spread.f90
@@ -1,10 +1,17 @@
program foo
integer, dimension (2, 3) :: a
integer, dimension (2, 2, 3) :: b
+ character (len=80) line1, line2, line3
a = reshape ((/1, 2, 3, 4, 5, 6/), (/2, 3/))
b = spread (a, 1, 2)
if (any (b .ne. reshape ((/1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6/), &
(/2, 2, 3/)))) &
call abort
+ write(line1, 9000) b
+ write(line2, 9000) spread (a, 1, 2)
+ if (line1 /= line2) call abort
+ write(line3, 9000) spread (a, 1, 2) + 0
+ if (line1 /= line2) call abort
+9000 format(12I3)
end program