summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gnat.dg/discr7.adb
blob: 3bb61cb12b694b5cb5ce7a941b28b1ac522965a1 (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
-- { dg-do compile }

procedure Discr7 is

  subtype Index is Natural range 0..5;
  type BitString is array(Index range <>) of Boolean;
  pragma Pack(BitString);

  function Id (I : Integer) return Integer is
  begin
    return I;
  end;

  type E(D : Index) is record
    C : BitString(1..D);
  end record;

  subtype E0 is E(Id(0));

  function F return E0 is
  begin
    return E'(D=>0, C=>(1..0=>FALSE));
  end;

begin
  null;
end;