PR inline-asm/84742
[official-gcc.git] / gcc / testsuite / gfortran.dg / vect / no-fre-no-copy-prop-O3-pr51704.f90
blobbf2ca0e953d6b73f6ea0d75dc7fb606c40aac1dd
1 ! { dg-do compile }
3 integer, parameter :: q = 2
4 integer, parameter :: nx=3, ny=2*q, nz=5
5 integer, parameter, dimension(nx,ny,nz) :: p = &
6 & reshape ((/ (i**2, i=1,size(p)) /), shape(p))
7 integer, parameter, dimension( ny,nz) :: px = &
8 & reshape ((/ (( &
9 & + nx*(nx-1)*(2*nx-1)/6, &
10 & j=0,ny-1), k=0,nz-1) /), shape(px))
11 integer, parameter, dimension(nx, nz) :: py = &
12 & reshape ((/ (( &
13 & +(nx )**2*ny*(ny-1)*(2*ny-1)/6, &
14 & i=0,nx-1), k=0,nz-1) /), shape(py))
15 integer, parameter, dimension(nx,ny ) :: pz = &
16 & reshape ((/ (( &
17 & +(nx*ny)**2*nz*(nz-1)*(2*nz-1)/6, &
18 & i=0,nx-1), j=0,ny-1) /), shape(pz))
19 integer, dimension(nx,ny,nz) :: a
20 integer, dimension(nx,ny ) :: az
21 if (sum(sum(sum(a,1),2),1) /= sum(a)) STOP 1
22 if (sum(sum(sum(a,3),1),1) /= sum(a)) STOP 2
23 if (any(1+sum(eid(a),1)+ax+sum( &
24 neid3(a), &
25 1)+1 /= 3*ax+2)) STOP 3
26 if (any(1+eid(sum(a,2))+ay+ &
27 neid2( &
28 sum(a,2) &
29 )+1 /= 3*ay+2)) STOP 4
30 if (any(sum(eid(sum(a,3))+az+2* &
31 neid2(az) &
32 ,1)+1 /= 4*sum(az,1)+1)) STOP 5
33 contains
34 elemental function eid (x)
35 integer, intent(in) :: x
36 end function eid
37 function neid2 (x)
38 integer, intent(in) :: x(:,:)
39 integer :: neid2(size(x,1),size(x,2))
40 neid2 = x
41 end function neid2
42 function neid3 (x)
43 integer, intent(in) :: x(:,:,:)
44 integer :: neid3(size(x,1),size(x,2),size(x,3))
45 end function neid3
46 elemental subroutine set (o, i)
47 integer, intent(in) :: i
48 integer, intent(out) :: o
49 end subroutine set
50 elemental subroutine tes (i, o)
51 integer, intent(in) :: i
52 integer, intent(out) :: o
53 end subroutine tes
54 end