Debian Codegraph @

gcc/testsuite/gfortran.dg/unsigned_31.f90

raw
1 ! { dg-do run }
2 ! { dg-options "-funsigned" }
3 program memain
4 call test1
5 call test2
6 contains
7 subroutine test1
8 unsigned, dimension(3) :: v
9 unsigned, dimension(3,3) :: w, x
10 integer, dimension(3) :: shft
11 v = [1u, 2u, 3u]
12 if (any(eoshift(v,1) /= [2u,3u,0u])) error stop 1
13 w = reshape([1u,2u,3u,4u,5u,6u,7u,8u,9u],[3,3])
14 x = eoshift(w, shift=[1,-2,1], boundary=10u, dim=1)
15 if (any(x /= reshape([2u,3u,10u,10u,10u,4u,8u,9u,10u],[3,3]))) error stop 2
16 shft = [2,-1,-2]
17 x = eoshift(w,shift=shft,boundary=20u,dim=2)
18 if (any(x /= reshape([7u,20u,20u,20u,2u,20u,20u,5u,3u],[3,3]))) error stop 3
19 end subroutine test1
20 subroutine test2
21 unsigned, dimension(3), parameter :: v = eoshift([1u,2u,3u],1)
22 unsigned, dimension(3,3), parameter :: w = reshape([1u,2u,3u,4u,5u,6u,7u,8u,9u],[3,3])
23 unsigned, dimension(3,3), parameter :: x = eoshift(w,shift=[1,-2,1], boundary=10u, dim=1)
24 if (any(v /= [2u,3u,0u])) error stop 11
25 if (any(x /= reshape([2u,3u,10u,10u,10u,4u,8u,9u,10u],[3,3]))) error stop 2
26 end subroutine test2
27 end program memain