[C++ PATCH] Deprecate -ffriend-injection
[official-gcc.git] / gcc / testsuite / gfortran.dg / simplify_cshift_4.f90
blobbbbe2a53941e9cd4d0f71395a56e14f82b0925f7
1 ! { dg-do run }
2 program main
3 implicit none
4 integer :: i
5 integer, parameter, dimension(3,3) :: a = &
6 reshape([1,2,3,4,5,6,7,8,9], shape(a))
7 integer, dimension(3,3) :: b
8 integer, parameter, dimension(3,4,5) :: c = &
9 reshape([(i**2,i=1,3*4*5)],shape(c))
10 integer, dimension(3,4,5) :: d
11 integer, dimension(4,5), parameter :: sh1 =&
12 reshape([(i**3-12*i**2,i=1,4*5)],shape(sh1))
13 integer, dimension(3,5), parameter :: sh2 = &
14 reshape([(i**3-7*i**2,i=1,3*5)], shape(sh2))
15 integer, dimension(3,4), parameter :: sh3 = &
16 reshape([(i**3-3*i**2,i=1,3*4)], shape(sh3))
17 integer, parameter, dimension(3,4,5) :: c1 = cshift(c,shift=sh1,dim=1)
18 integer, parameter, dimension(3,4,5) :: c2 = cshift(c,shift=sh2,dim=2)
19 integer, parameter, dimension(3,4,5) :: c3 = cshift(c,shift=sh3,dim=3)
21 b = a
22 if (any(cshift(a,1) /= cshift(b,1))) call abort
23 if (any(cshift(a,2) /= cshift(b,2))) call abort
24 if (any(cshift(a,1,dim=2) /= cshift(b,1,dim=2))) call abort
25 d = c
26 if (any(cshift(c,1) /= cshift(d,1))) call abort
27 if (any(cshift(c,2) /= cshift(d,2))) call abort
28 if (any(cshift(c,3) /= cshift(d,3))) call abort
30 if (any(cshift(c,1,dim=2) /= cshift(d,1,dim=2))) call abort
31 if (any(cshift(c,2,dim=2) /= cshift(d,2,dim=2))) call abort
32 if (any(cshift(c,3,dim=3) /= cshift(d,3,dim=3))) call abort
34 if (any(cshift(d,shift=sh1,dim=1) /= c1)) call abort
35 if (any(cshift(d,shift=sh2,dim=2) /= c2)) call abort
36 if (any(cshift(d,shift=sh3,dim=3) /= c3)) call abort
37 end program main