2010-04-20 Richard Guenther <rguenther@suse.de>
[official-gcc.git] / gcc / testsuite / gnat.dg / unaligned_rep_clause.adb
blobffaa076eec1ce58a094ae1f643fffd38c23d4384
1 -- { dg-do compile }
3 procedure Unaligned_Rep_Clause is
5 type One_Bit_Record is
6 record
7 B : Boolean;
8 end record;
9 Pragma Pack(One_Bit_Record);
11 subtype Version_Number_Type is String (1 .. 3);
13 type Inter is
14 record
15 Version : Version_Number_Type;
16 end record;
18 type Msg_Type is
19 record
20 Status : One_Bit_Record;
21 Version : Inter;
22 end record;
24 for Msg_Type use
25 record
26 Status at 0 range 0 .. 0;
27 Version at 0 range 1 .. 24;
28 end record;
29 for Msg_Type'Size use 25;
31 Data : Msg_Type;
32 Pragma Warnings (Off, Data);
33 Version : Inter;
35 begin
36 Version := Data.Version;
37 end;