OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [gfortran.dg/] [masklr_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 MASKL and MASKR intrinsics.
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,KIND,FUNCL,FUNCR,RESL,RESR) \
8
  if (maskl(I,KIND) /= RESL) call abort ; \
9
  if (FUNCL(I) /= RESL) call abort ; \
10
  if (maskr(I,KIND) /= RESR) call abort ; \
11
  if (FUNCR(I) /= RESR) call abort
12
 
13
  CHECK(0,16,run_maskl16,run_maskr16,0_16,0_16)
14
  CHECK(1,16,run_maskl16,run_maskr16,-huge(0_16)-1_16,1_16)
15
  CHECK(2,16,run_maskl16,run_maskr16,(-huge(0_16)-1_16)/2_16,3_16)
16
  CHECK(3,16,run_maskl16,run_maskr16,(-huge(0_16)-1_16)/4_16,7_16)
17
  CHECK(int(bit_size(0_16))-2,16,run_maskl16,run_maskr16,-4_16,huge(0_16)/2_16)
18
  CHECK(int(bit_size(0_16))-1,16,run_maskl16,run_maskr16,-2_16,huge(0_16))
19
  CHECK(int(bit_size(0_16)),16,run_maskl16,run_maskr16,-1_16,-1_16)
20
 
21
contains
22
 
23
  pure integer(kind=16) function run_maskl16(i) result(res)
24
    integer, intent(in) :: i
25
    res = maskl(i,kind=16)
26
  end function
27
  pure integer(kind=16) function run_maskr16(i) result(res)
28
    integer, intent(in) :: i
29
    res = maskr(i,kind=16)
30
  end function
31
 
32
end

powered by: WebSVN 2.1.0

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