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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [gfortran.dg/] [ishft_3.f90] - Rev 694

Compare with Previous | Blame | View Log

! { dg-do compile }
! PR fortran/50514
program ishft_3

   implicit none

   integer j, m

   m = 42
   !
   ! These should compile.
   !
   j = ishft(m, 16)
   j = ishft(m, -16)
   j = ishftc(m, 16)
   j = ishftc(m, -16)
   !
   ! These should issue an error.
   !
   j = ishft(m, 640)    ! { dg-error "absolute value of SHIFT" }
   j = ishftc(m, 640)   ! { dg-error "absolute value of SHIFT" }
   j = ishft(m, -640)   ! { dg-error "absolute value of SHIFT" }
   j = ishftc(m, -640)  ! { dg-error "absolute value of SHIFT" }

   ! abs(SHIFT) must be <= SIZE

   j = ishftc(m,  1, 2)
   j = ishftc(m,  1, 2)
   j = ishftc(m, -1, 2)
   j = ishftc(m, -1, 2)

   j = ishftc(m,  10, 2)! { dg-error "absolute value of SHIFT" }
   j = ishftc(m,  10, 2)! { dg-error "absolute value of SHIFT" }
   j = ishftc(m, -10, 2)! { dg-error "absolute value of SHIFT" }
   j = ishftc(m, -10, 2)! { dg-error "absolute value of SHIFT" }

   j = ishftc(m, 1, -2) ! { dg-error "must be positive" }
end program

Compare with Previous | Blame | View Log

powered by: WebSVN 2.1.0

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