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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [gfortran.fortran-torture/] [compile/] [transfer-1.f90] - Rev 695

Compare with Previous | Blame | View Log

! Bigendian test posted by Perseus in comp.lang.fortran on 4 July 2005.
   integer(1), parameter :: zero = 0
   LOGICAL, PARAMETER :: bigend = IACHAR(TRANSFER(1,"a")) == zero
   LOGICAL :: bigendian
   call foo ()
contains
   subroutine foo ()
   integer :: chr, ans
   if (bigend) then
     ans = 1
   else
     ans = 0
   end if
   chr = IACHAR(TRANSFER(1,"a"))
   bigendian =  chr == 0_4
   if (bigendian) then
     ans = 1
   else
     ans = 0
   end if
   end subroutine foo
end

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.