PR tree-optimization/86415 - strlen() not folded for substrings within constant arrays
[official-gcc.git] / gcc / testsuite / gfortran.dg / shift-alloc.f90
blob70f1cbb660e570cdd9068320cbe836b393de9286
1 ! { dg-do run }
2 ! PR 22144: eoshift1, eoshift3 and cshift1 used to lack memory
3 ! allocation, which caused the writes to segfault.
4 program main
5 implicit none
6 integer, dimension (:,:),allocatable :: a
7 integer, dimension (3) :: sh, bo
8 character(len=80) line1, line2
9 integer :: i
11 allocate (a(3,3))
12 a = reshape((/(i,i=1,9)/),shape(a))
13 sh = (/ 2, -1, -2 /)
14 bo = (/ -3, -2, -1 /)
15 write(unit=line1,fmt='(10I5)') cshift(a, shift=sh)
16 write(unit=line1,fmt='(10I5)') eoshift(a, shift=sh)
17 write(unit=line1,fmt='(10I5)') eoshift(a, shift=sh, boundary=bo)
18 end program main