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/] [rep_clause2.ads] - Blame information for rev 327

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

Line No. Rev Author Line
1 304 jeremybenn
with Unchecked_Conversion;
2
 
3
package Rep_Clause2 is
4
 
5
   type Tiny is range 0 .. 3;
6
   for Tiny'Size use 2;
7
 
8
   type Small is range 0 .. 255;
9
   for Small'Size use 8;
10
 
11
   type Small_Data is record
12
      D : Tiny;
13
      N : Small;
14
   end record;
15
   pragma Pack (Small_Data);
16
 
17
   type Chunk is
18
   record
19
      S : Small_Data;
20
      C : Character;
21
   end record;
22
 
23
   for Chunk use record
24
      S at 0 range  0 .. 15;
25
      C at 2 range  0 .. 7;
26
   end record;
27
 
28
   type Index is range 1 .. 10;
29
 
30
   type Data_Array is array (Index) of Chunk;
31
   for Data_Array'Alignment use 2;
32
   pragma Pack (Data_Array);
33
 
34
   type Data is record
35
     D : Data_Array;
36
   end record;
37
 
38
   type Bit is range 0 .. 1;
39
   for Bit'Size use 1;
40
 
41
   type Bit_Array is array (Positive range <>) of Bit;
42
   pragma Pack (Bit_Array);
43
 
44
   type Byte is new Bit_Array (1 .. 8);
45
   for  Byte'Size use 8;
46
   for  Byte'Alignment use 1;
47
 
48
   function Conv
49
     is new Unchecked_Conversion(Source => Small, Target => Byte);
50
 
51
   procedure Assign (From : Data; Offset : Positive; I : Index; To : out Bit_Array);
52
 
53
end Rep_Clause2;

powered by: WebSVN 2.1.0

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