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

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 304 jeremybenn
-- { dg-do compile }
2
-- { dg-options "-O2" }
3
 
4
function slice1 (Offset : Integer) return String is
5
 
6
   Convert : constant String := "0123456789abcdef";
7
   Buffer  : String (1 .. 32);
8
   Pos     : Natural := Buffer'Last;
9
   Value   : Long_Long_Integer := Long_Long_Integer (Offset);
10
 
11
begin
12
   while Value > 0 loop
13
      Buffer (Pos) := Convert (Integer (Value mod 16));
14
      Pos := Pos - 1;
15
      Value := Value / 16;
16
   end loop;
17
 
18
   return Buffer (Pos + 1 .. Buffer'Last);
19
end;

powered by: WebSVN 2.1.0

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