URL
https://opencores.org/ocsvn/openrisc/openrisc/trunk
Subversion Repositories openrisc
[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [gfortran.dg/] [merge_bits_2.F90] - Rev 694
Compare with Previous | Blame | View Log
! Test the MERGE_BITS intrinsic
!
! { dg-do run }
! { dg-options "-ffree-line-length-none" }
! { dg-require-effective-target fortran_integer_16 }
#define CHECK(I,J,K) \
if (merge_bits(I,J,K) /= ior(iand(I,K),iand(J,not(K)))) call abort ; \
if (run_merge(I,J,K) /= merge_bits(I,J,K)) call abort
CHECK(13_16,18_16,22_16)
CHECK(-13_16,18_16,22_16)
CHECK(13_16,-18_16,22_16)
CHECK(13_16,18_16,-22_16)
contains
function run_merge (i, j, k) result(res)
integer(kind=16) :: i, j, k, res
res = merge_bits(i,j,k)
end function
end