Debian Codegraph @

gcc/testsuite/gnat.dg/aggr28.adb

raw
1 -- { dg-do run }
2
3 procedure Aggr28 is
4
5 Count : Natural := 0;
6
7 function Get (S: String) return String is
8 begin
9 Count := Count + 1;
10 return S;
11 end;
12
13 Max_Error_Length : constant := 8;
14 subtype Error_Type is String (1 .. Max_Error_Length);
15
16 type Rec is record
17 Text : Error_Type;
18 end record;
19
20 type Arr is array (1 .. 16) of Rec;
21
22 Table : constant Arr :=
23 (3 => (Text => Get ("INVALID ")), others => (Text => Get ("OTHERS ")));
24
25 begin
26 if Count /= Table'Length then
27 raise Program_Error;
28 end if;
29 end;