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

Subversion Repositories openrisc_me

[/] [openrisc/] [trunk/] [gnu-src/] [gcc-4.2.2/] [gcc/] [testsuite/] [gnat.dg/] [loop_unchecked_conversion.adb] - Blame information for rev 310

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 149 jeremybenn
-- { dg-do compile }
2
-- { dg-options "-gnatws -O" }
3
 
4
with Unchecked_Conversion;
5
 
6
package body loop_unchecked_conversion is
7
 
8
   type Byte is mod 2**8;
9
 
10
   type List is array (Natural range <>) of Byte;
11
 
12
   subtype Integer_List is List (1 .. 4);
13
 
14
   function Integer_Down is new
15
     Unchecked_Conversion (Source => Integer, Target => Integer_List);
16
 
17
   type Storage (Size : Integer) is
18
      record
19
         Data : List (1 .. Size);
20
      end record;
21
 
22
   type Storage_Pointer is access Storage;
23
 
24
   The_Data_Storage : Storage_Pointer;
25
 
26
   procedure slice is
27
   begin
28
      for I in 0 .. 1 loop
29
         The_Data_Storage.Data (I+1 .. I+4) := Integer_Down (I);
30
      end loop;
31
   end;
32
 
33
end loop_unchecked_conversion;

powered by: WebSVN 2.1.0

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