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

Subversion Repositories openrisc_me

[/] [openrisc/] [trunk/] [gnu-src/] [gcc-4.5.1/] [gcc/] [testsuite/] [gnat.dg/] [slice1.adb] - Rev 304

Compare with Previous | Blame | View Log

-- { dg-do compile }
-- { dg-options "-O2" }
 
function slice1 (Offset : Integer) return String is
 
   Convert : constant String := "0123456789abcdef";
   Buffer  : String (1 .. 32);
   Pos     : Natural := Buffer'Last;
   Value   : Long_Long_Integer := Long_Long_Integer (Offset);
 
begin
   while Value > 0 loop
      Buffer (Pos) := Convert (Integer (Value mod 16));
      Pos := Pos - 1;
      Value := Value / 16;
   end loop;
 
   return Buffer (Pos + 1 .. Buffer'Last);
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.