Debian Codegraph @

gcc/testsuite/gnat.dg/pack25.adb

raw
1 -- { dg-do run }
2 procedure Pack25 is
3
4 type Bit is ('0', '1');
5 type Bit_Array is array (Natural range <>) of Bit;
6 pragma Pack (Bit_Array);
7
8 procedure Test (Bits : Bit_Array; Size : Natural) is
9 begin
10 if Bits (0 .. Size - 1)'Size /= Size then
11 raise Program_Error;
12 end if;
13 end;
14
15 A : Bit_Array (0 .. 127) := (others => '1');
16
17 begin
18 for X in A'First .. A'Last + 1 loop
19 Test (A, X);
20 end loop;
21 end;