OpenCores
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] - Blame information for rev 774

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 694 jeremybenn
! Test the MERGE_BITS intrinsic
2
!
3
! { dg-do run }
4
! { dg-options "-ffree-line-length-none" }
5
! { dg-require-effective-target fortran_integer_16 }
6
 
7
#define CHECK(I,J,K) \
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
10
 
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)
15
 
16
contains
17
 
18
  function run_merge (i, j, k) result(res)
19
    integer(kind=16) :: i, j, k, res
20
    res = merge_bits(i,j,k)
21
  end function
22
end

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.