* fi.po: Update.
[official-gcc.git] / gcc / testsuite / gnat.dg / opt46.adb
blob64e0b632e3a8be5d4ab66603194e322e224eec73
1 -- { dg-do compile }
2 -- { dg-options "-O" }
4 with Ada.Unchecked_Deallocation;
6 with Opt46_Pkg;
8 package body Opt46 is
10 type Pattern is abstract tagged null record;
12 type Pattern_Access is access Pattern'Class;
14 procedure Free is new Ada.Unchecked_Deallocation
15 (Pattern'Class, Pattern_Access);
17 type Action is abstract tagged null record;
19 type Action_Access is access Action'Class;
21 procedure Free is new Ada.Unchecked_Deallocation
22 (Action'Class, Action_Access);
24 type Pattern_Action is record
25 Pattern : Pattern_Access;
26 Action : Action_Access;
27 end record;
29 package Pattern_Action_Table is new Opt46_Pkg (Pattern_Action, Natural, 1);
31 type Session_Data is record
32 Filters : Pattern_Action_Table.Instance;
33 end record;
35 procedure Close (Session : Session_Type) is
36 Filters : Pattern_Action_Table.Instance renames Session.Data.Filters;
37 begin
38 for F in 1 .. Pattern_Action_Table.Last (Filters) loop
39 Free (Filters.Table (F).Pattern);
40 Free (Filters.Table (F).Action);
41 end loop;
43 end Close;
45 end Opt46;