| 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 |
| 10 |
|
| 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 |