summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gnat.dg/nested_agg_bitfield_constructor.adb
blob: 6015900c5aa2185570b166906ee821f108f9f2bb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
-- { dg-do compile }
-- { dg-options "-gnatws" }
--              (bits of "Header" unused)

procedure Nested_Agg_Bitfield_Constructor is

    type Uint64 is mod 2 ** 64;
    type Uint16 is mod 2 ** 16;

    type Time_Stamp is record
       Sec  : Uint64;
       Year : Uint16;
    end record;

    type Msg_Header is record
       Stamp : Time_Stamp;
    end record;
    for Msg_Header use record
       Stamp at 0 range 0 .. 64+16-1;
    end record;
    for Msg_Header'Size use 80;

    type Msg is record
       Header : Msg_Header;
    end record;

    for Msg use record
       Header at 0 range 0 .. 191;
    end record;

    M : Msg := (Header => (Stamp => (2, 4)));
begin
   null;
end;