RISC-V: Add support for riscv-*-*.
[official-gcc.git] / gcc / testsuite / gnat.dg / rep_clause2.ads
blobc4d07236899b7abd3a967e3e9720b358b1facb94
1 with Unchecked_Conversion;
3 package Rep_Clause2 is
5 type Tiny is range 0 .. 3;
6 for Tiny'Size use 2;
8 type Small is range 0 .. 255;
9 for Small'Size use 8;
11 type Small_Data is record
12 D : Tiny;
13 N : Small;
14 end record;
15 pragma Pack (Small_Data);
17 type Chunk is
18 record
19 S : Small_Data;
20 C : Character;
21 end record;
23 for Chunk use record
24 S at 0 range 0 .. 15;
25 C at 2 range 0 .. 7;
26 end record;
28 type Index is range 1 .. 10;
30 type Data_Array is array (Index) of Chunk;
31 for Data_Array'Alignment use 2;
32 pragma Pack (Data_Array);
34 type Data is record
35 D : Data_Array;
36 end record;
38 type Bit is range 0 .. 1;
39 for Bit'Size use 1;
41 type Bit_Array is array (Positive range <>) of Bit;
42 pragma Pack (Bit_Array);
44 type Byte is new Bit_Array (1 .. 8);
45 for Byte'Size use 8;
46 for Byte'Alignment use 1;
48 function Conv
49 is new Unchecked_Conversion(Source => Small, Target => Byte);
51 procedure Assign (From : Data; Offset : Positive; I : Index; To : out Bit_Array);
53 end Rep_Clause2;