2016-11-21 Thomas Preud'homme <thomas.preudhomme@arm.com>
[official-gcc.git] / gcc / testsuite / gnat.dg / specs / static_initializer3.ads
blob2dc8be1e5beb954b54d2a5ff31a0ecb130391e9f
1 -- { dg-do compile }
3 with Unchecked_Conversion;
5 package Static_Initializer3 is
7 type Byte is range 0 .. 16#FF#;
8 for Byte'Size use 8;
10 type Word is range 0 .. 16#FFFF# ;
11 for Word'Size use 16;
13 type R is record
14 b1 : Boolean;
15 b2 : Boolean;
16 end record;
17 for R use record
18 b1 at 0 range 0..3;
19 b2 at 0 range 4..7;
20 end record;
21 for R'Size use 8;
23 function Conv is new Unchecked_Conversion (R, Byte);
25 C1 : constant Byte := Conv ((true, false));
27 C2 : constant Word := Word(C1);
29 end Static_Initializer3;