aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
Diffstat (limited to 'gcc')
-rw-r--r--gcc/testsuite/ChangeLog5
-rw-r--r--gcc/testsuite/gfortran.dg/shift-alloc.f9018
2 files changed, 23 insertions, 0 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 70b830b..419e012 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,8 @@
+2005-06-25 Thomas Koenig <Thomas.Koenig@online.de>
+
+ PR libfortran/21144
+ * gfortran.dg/shift-alloc.f90: New testcase.
+
2005-06-25 Kelley Cook <kcook@gcc.gnu.org>
* all files: Update FSF address in copyright headers.
diff --git a/gcc/testsuite/gfortran.dg/shift-alloc.f90 b/gcc/testsuite/gfortran.dg/shift-alloc.f90
new file mode 100644
index 0000000..2d66031
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/shift-alloc.f90
@@ -0,0 +1,18 @@
+! { dg do-run }
+! PR 22144: eoshift1, eoshift3 and cshift1 used to lack memory
+! allocation, which caused the writes to segfault.
+program main
+ implicit none
+ integer, dimension (:,:),allocatable :: a
+ integer, dimension (3) :: sh, bo
+ character(len=80) line1, line2
+ integer :: i
+
+ allocate (a(3,3))
+ a = reshape((/(i,i=1,9)/),shape(a))
+ sh = (/ 2, -1, -2 /)
+ bo = (/ -3, -2, -1 /)
+ write(unit=line1,fmt='(10I5)') cshift(a, shift=sh)
+ write(unit=line1,fmt='(10I5)') eoshift(a, shift=sh)
+ write(unit=line1,fmt='(10I5)') eoshift(a, shift=sh, boundary=bo)
+end program main