2 ! Some CSHIFT, EOSHIFT and UNPACK conformance tests
6 real, dimension(1) :: a1, b1, c1
7 real, dimension(1,1) :: a2, b2, c2
8 real, dimension(1,0) :: a, b, c
9 real :: tempn(1), tempv(5)
10 real,allocatable :: foo(:)
20 b1 = cshift (a1,(/1/)) ! { dg-error "must be a scalar" }
22 b2 = eoshift (a1,c1(1)) ! { dg-error "must be INTEGER" }
23 b1 = eoshift (a1,(/1/)) ! { dg-error "must be a scalar" }
24 b1 = eoshift (a1,1,boundary=c1) ! { dg-error "must be a scalar" }
25 b1 = eoshift (a1,(/1/), boundary=c2) ! { dg-error "must be a scalar" }
28 b2 = cshift (a2,(/1/))
29 b2 = cshift (a2,reshape([1],[1,1])) ! { dg-error "have rank 1 or be a scalar" }
31 b2 = eoshift (a2,c1) ! { dg-error "must be INTEGER" }
32 b2 = eoshift (a2,(/1/))
33 b2 = eoshift (a2,reshape([1],[1,1]), boundary=c1) ! { dg-error "have rank 1 or be a scalar" }
34 b2 = eoshift (a2,1,boundary=c2(:,:)) ! { dg-error "have rank 1 or be a scalar" }
35 b2 = eoshift (a2,(/1/), boundary=c2(:,:)) ! { dg-error "have rank 1 or be a scalar" }
37 b = eoshift (a,(/1/), boundary=c(1,:)) ! { dg-error "invalid shape in dimension" }
39 if (any(eoshift(foo,dim=1,shift=1,boundary=(/42.0,-7.0/))/= 0)) call abort() ! { dg-error "must be a scalar" }
40 if (any(eoshift(tempn(2:1),dim=1,shift=1,boundary=(/42.0,-7.0/))/= 0)) call abort() ! { dg-error "must be a scalar" }
42 if (any(unpack(tempv,tempv(1:0)/=0,tempv) /= -47)) call abort() ! { dg-error "must have identical shape" }
43 if (any(unpack(tempv(5:4),tempv(1:0)/=0,tempv) /= -47)) call abort() ! { dg-error "must have identical shape" }