Merge -r 127928:132243 from trunk
[official-gcc.git] / gcc / testsuite / gfortran.dg / shift-kind_2.f90
blob30e32639820c8ea31284780c5f0eb55a1f4625c3
1 ! { dg-do run }
2 ! PR34540 cshift, eoshift, kind=1 and kind=2 arguments...
3 program main
4 integer(kind=1) :: d1
5 integer(kind=2) :: d2
6 integer(kind=4) :: d4
7 integer(kind=8) :: d8
8 integer(kind=1), dimension(2) :: s1
9 integer(kind=2), dimension(2) :: s2
10 integer(kind=4), dimension(2) :: s4
11 integer(kind=8), dimension(2) :: s8
12 real, dimension(2,2) :: r, r1, r2
13 data r /1.0, 2.0, 3.0, 4.0/
14 data r1 /2.0, 0.0, 4.0, 0.0/
15 data r2 /2.0, 1.0, 4.0, 3.0/
16 s1 = (/1, 1/)
17 s2 = (/1, 1/)
18 s4 = (/1, 1/)
19 s8 = (/1, 1/)
20 d1 = 1
21 d2 = 1
22 d4 = 1
23 d8 = 1
24 if (any(eoshift(r,shift=s1,dim=d1) /= r1)) call abort
25 if (any(eoshift(r,shift=s2,dim=d2) /= r1)) call abort
26 if (any(eoshift(r,shift=s4,dim=d4) /= r1)) call abort
27 if (any(eoshift(r,shift=s8,dim=d8) /= r1)) call abort
28 if (any(cshift(r,shift=s1,dim=d1) /= r2)) call abort
29 if (any(cshift(r,shift=s2,dim=d2) /= r2)) call abort
30 if (any(cshift(r,shift=s4,dim=d4) /= r2)) call abort
31 if (any(cshift(r,shift=s8,dim=d8) /= r2)) call abort
32 end program main