annotate gcc/testsuite/gnat.dg/pack17.adb @ 145:1830386684a0

gcc-9.2.0
author anatofuz
date Thu, 13 Feb 2020 11:34:05 +0900
parents 04ced10e8804
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
111
kono
parents:
diff changeset
1 -- { dg-do run }
kono
parents:
diff changeset
2
kono
parents:
diff changeset
3 procedure Pack17 is
kono
parents:
diff changeset
4
kono
parents:
diff changeset
5 type Bitmap_T is array (Natural range <>) of Boolean;
kono
parents:
diff changeset
6 pragma Pack (Bitmap_T);
kono
parents:
diff changeset
7
kono
parents:
diff changeset
8 type Uint8 is range 0 .. 2 ** 8 - 1;
kono
parents:
diff changeset
9 for Uint8'Size use 8;
kono
parents:
diff changeset
10
kono
parents:
diff changeset
11 type Record_With_QImode_Variants (D : Boolean) is record
kono
parents:
diff changeset
12 C_Filler : Bitmap_T (1..7);
kono
parents:
diff changeset
13 C_Map : Bitmap_T (1..3);
kono
parents:
diff changeset
14 case D is
kono
parents:
diff changeset
15 when False =>
kono
parents:
diff changeset
16 F_Bit : Boolean;
kono
parents:
diff changeset
17 F_Filler : Bitmap_T (1..7);
kono
parents:
diff changeset
18 when True =>
kono
parents:
diff changeset
19 T_Int : Uint8;
kono
parents:
diff changeset
20 end case;
kono
parents:
diff changeset
21 end record;
kono
parents:
diff changeset
22 pragma Pack (Record_With_QImode_Variants);
kono
parents:
diff changeset
23
kono
parents:
diff changeset
24 procedure Fill (R : out Record_With_QImode_Variants) is
kono
parents:
diff changeset
25 begin
kono
parents:
diff changeset
26 R.C_Filler := (True, False, True, False, True, False, True);
kono
parents:
diff changeset
27 R.C_Map := (True, False, True);
kono
parents:
diff changeset
28 R.T_Int := 17;
kono
parents:
diff changeset
29 end;
kono
parents:
diff changeset
30
kono
parents:
diff changeset
31 RT : Record_With_QImode_Variants (D => True);
kono
parents:
diff changeset
32
kono
parents:
diff changeset
33 begin
kono
parents:
diff changeset
34 Fill (RT);
kono
parents:
diff changeset
35 if RT.T_Int /= 17 then
kono
parents:
diff changeset
36 raise Program_Error;
kono
parents:
diff changeset
37 end if;
kono
parents:
diff changeset
38 end;