Debian Codegraph @

gcc/testsuite/gnat.dg/equal11.adb

raw
1 -- { dg-do run }
2
3 with Equal11_Record;
4
5 procedure Equal11 is
6
7 use Equal11_Record;
8
9 R : My_Record_Type;
10 L : My_Record_Type_List_Pck.List;
11 begin
12 -- Single record
13 R.F := 42;
14 R.Put;
15 if Put_Result /= 42 then
16 raise Program_Error;
17 end if;
18
19 -- List of records
20 L.Append ((F => 3));
21 L.Append ((F => 2));
22 L.Append ((F => 1));
23
24 declare
25 Expected : constant array (Positive range <>) of Integer :=
26 (3, 2, 1);
27 I : Positive := 1;
28 begin
29 for LR of L loop
30 LR.Put;
31 if Put_Result /= Expected (I) then
32 raise Program_Error;
33 end if;
34 I := I + 1;
35 end loop;
36 end;
37 end Equal11;