1 ! Test the MERGE_BITS intrinsic
4 ! { dg-options "-ffree-line-length-none" }
5 ! { dg-require-effective-target fortran_integer_16 }
8 if (merge_bits(I,J,K) /= ior(iand(I,K),iand(J,not(K)))) call abort ; \
9 if (run_merge(I,J,K) /= merge_bits(I,J,K)) call abort
11 CHECK(13_16,18_16,22_16)
12 CHECK(-13_16,18_16,22_16)
13 CHECK(13_16,-18_16,22_16)
14 CHECK(13_16,18_16,-22_16)
18 function run_merge (i, j, k) result(res)
19 integer(kind=16) :: i, j, k, res
20 res = merge_bits(i,j,k)