aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gnat.dg/aggr28.adb
blob: 3375b71346f12912fa275d4e7857bf103d2e0dc4 (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
--  { dg-do run }

procedure Aggr28 is

  Count : Natural := 0;

  function Get (S: String) return String is
  begin
    Count := Count + 1;
    return S;
  end;

  Max_Error_Length : constant := 8;
  subtype Error_Type is String (1 .. Max_Error_Length);

  type Rec is record
    Text : Error_Type;
  end record;

  type Arr is array (1 .. 16) of Rec;

  Table : constant Arr :=
    (3 => (Text => Get ("INVALID ")), others => (Text => Get ("OTHERS  ")));

begin
  if Count /= Table'Length then
    raise Program_Error;
  end if;
end;