1 ! Test the DSHIFTL and DSHIFTR intrinsics.
4 ! { dg-options "-ffree-line-length-none" }
5 ! { dg-require-effective-target fortran_integer_16 }
9 #define RESL(I,J,SHIFT) \
10 IOR(SHIFTL(I,SHIFT),SHIFTR(J,BIT_SIZE(J)-SHIFT))
11 #define RESR(I,J,SHIFT) \
12 IOR(SHIFTL(I,BIT_SIZE(I)-SHIFT),SHIFTR(J,SHIFT))
14 #define CHECK(I,J,SHIFT) \
15 if (dshiftl(I,J,SHIFT) /= RESL(I,J,SHIFT)) call abort ; \
16 if (dshiftr(I,J,SHIFT) /= RESR(I,J,SHIFT)) call abort ; \
17 if (run_dshiftl(I,J,SHIFT) /= RESL(I,J,SHIFT)) call abort ; \
18 if (run_dshiftr(I,J,SHIFT) /= RESR(I,J,SHIFT)) call abort
39 CHECK(-28_16,-79_16,0)
40 CHECK(-28_16,-79_16,1)
41 CHECK(-28_16,-79_16,5)
42 CHECK(-28_16,-79_16,7)
43 CHECK(-28_16,-79_16,8)
47 function run_dshiftl (i, j, shift) result(res)
48 integer(kind=16) :: i, j, res
50 res = dshiftl(i,j,shift)
53 function run_dshiftr (i, j, shift) result(res)
54 integer(kind=16) :: i, j, res
56 res = dshiftr(i,j,shift)