2017-12-08 Richard Biener <rguenther@suse.de>
[official-gcc.git] / gcc / testsuite / gfortran.dg / shift-kind.f90
blob70d874813e844cf3de4c9b221d18369be9d3bf77
1 ! { dg-do compile }
2 ! PR 22143: We didn' have shift arguments to eoshift of kind=1
3 ! and kind=2.
4 program main
5 implicit none
6 integer, dimension (3,3) :: a, b, w
7 integer(kind=2), dimension (3) :: sh2
8 integer(kind=1), dimension (3) :: sh1
9 integer, dimension(3) :: bo
10 integer :: i,j
12 a = reshape((/(i,i=1,9)/),shape(a))
13 sh1 = (/ -3, -1, 3 /)
14 sh2 = (/ -3, -1, 3 /)
15 bo = (/-999, -99, -9 /)
16 b = cshift(a, shift=sh1)
17 call foo(b)
18 b = cshift(a, shift=sh2)
19 call foo(b)
21 b = eoshift(a, shift=sh1)
22 call foo(b)
23 b = eoshift(a, shift=sh1, boundary=bo)
24 call foo(b)
25 b = eoshift(a, shift=sh2)
26 call foo(b)
27 b = eoshift(a, shift=sh2, boundary=bo)
28 call foo(b)
30 end program main
32 subroutine foo(b)
33 ! Do nothing but confuse the optimizer into not removing the
34 ! function calls.
35 integer, dimension(3,3) :: b
36 end subroutine foo