aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorThomas Koenig <tkoenig@gcc.gnu.org>2007-03-25 08:29:10 +0000
committerThomas Koenig <tkoenig@gcc.gnu.org>2007-03-25 08:29:10 +0000
commitcc41ec4ebc020fdf032bb981b5990469649a8926 (patch)
treed7c59d1795dabf1eb44622906115c31d59e85ae1 /gcc
parent3ece6cc239ce0f85c306e3a2800582e6d8499b8d (diff)
downloadgcc-cc41ec4ebc020fdf032bb981b5990469649a8926.zip
gcc-cc41ec4ebc020fdf032bb981b5990469649a8926.tar.gz
gcc-cc41ec4ebc020fdf032bb981b5990469649a8926.tar.bz2
re PR fortran/31196 ([4.1 only] wrong code generated with RESHAPE/TRANSPOSE)
2007-03-25 Thomas Koenig <tkoenig@gcc.gnu.org> PR libfortran/31196 * intrinsics/reshape_generic.c (reshape_internal): Increment correct variable. 2007-03-25 Thomas Koenig <tkoenig@gcc.gnu.org> PR libfortran/31196 * gfortran.dg/reshape_transpose_1.f90: New test. From-SVN: r123195
Diffstat (limited to 'gcc')
-rw-r--r--gcc/testsuite/ChangeLog5
-rw-r--r--gcc/testsuite/gfortran.dg/reshape_transpose_1.f9018
2 files changed, 23 insertions, 0 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index e8650e4..8f31532 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,8 @@
+2007-03-25 Thomas Koenig <tkoenig@gcc.gnu.org>
+
+ PR libfortran/31196
+ * gfortran.dg/reshape_transpose_1.f90: New test.
+
2007-03-24 Francois-Xavier Coudert <fxcoudert@gcc.gnu.org>
PR fortran/30655
diff --git a/gcc/testsuite/gfortran.dg/reshape_transpose_1.f90 b/gcc/testsuite/gfortran.dg/reshape_transpose_1.f90
new file mode 100644
index 0000000..5ca5264
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/reshape_transpose_1.f90
@@ -0,0 +1,18 @@
+! { dg-do run }
+! PR 31196 - reshape of transposed derived types generated
+! wront results.
+program main
+ implicit none
+ TYPE datatype
+ INTEGER :: I
+ END TYPE datatype
+ character (len=20) line1, line2
+ TYPE(datatype), dimension(2,2) :: data, result
+ data(1,1)%i = 1
+ data(2,1)%i = 2
+ data(1,2)%i = 3
+ data(2,2)%i = 4
+ write (unit=line1, fmt="(4I4)") reshape(transpose(data),shape(data))
+ write (unit=line2, fmt="(4I4)") (/ 1, 3, 2, 4 /)
+ if (line1 /= line2) call abort
+END program main