Merge from mainline (165734:167278).
[official-gcc/graphite-test-results.git] / gcc / testsuite / gfortran.dg / cshift_bounds_1.f90
blob5932004f2f387b360599bbddc1b45290305a83c6
1 ! { dg-do run }
2 ! { dg-options "-fbounds-check" }
3 ! Check that empty arrays are handled correctly in
4 ! cshift and eoshift
5 program main
6 character(len=50) :: line
7 character(len=3), dimension(2,2) :: a, b
8 integer :: n1, n2
9 line = '-1-2'
10 read (line,'(2I2)') n1, n2
11 call foo(a, b, n1, n2)
12 a = 'abc'
13 write (line,'(4A)') eoshift(a, 3)
14 write (line,'(4A)') cshift(a, 3)
15 write (line,'(4A)') cshift(a(:,1:n1), 3)
16 write (line,'(4A)') eoshift(a(1:n2,:), 3)
17 end program main
19 subroutine foo(a, b, n1, n2)
20 character(len=3), dimension(2, n1) :: a
21 character(len=3), dimension(n2, 2) :: b
22 a = cshift(b,1)
23 a = eoshift(b,1)
24 end subroutine foo