c++: prvalue of array type [PR111286]
[official-gcc.git] / gcc / testsuite / gnat.dg / packed_subtype.adb
blob925440a41d85a63a72ecc6ea8684cbf5c645e5b3
1 -- { dg-do run }
3 procedure Packed_Subtype is
5 subtype Ubyte is Integer range 0 .. 255;
6 type Packet (Id : Ubyte) is record
7 A, B : Ubyte;
8 end record;
9 pragma Pack (Packet);
11 subtype My_Packet is Packet (Id => 1);
13 MP : My_Packet;
14 begin
15 MP.A := 1;
16 MP.B := 2;
18 if MP.A /= 1 or else MP.B /= 2 then
19 raise Program_Error;
20 end if;
21 end;