aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gnat.dg/opt75_pkg.ads
blob: 4fae165e77f7be683c5a3ff29cc16382e538f4dc (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
pragma Restrictions (No_Abort_Statements);
pragma Restrictions (Max_Asynchronous_Select_Nesting => 0);

with Ada.Finalization;
with System.Atomic_Counters;

package Opt75_Pkg is

  type Rec is record
    Counter : System.Atomic_Counters.Atomic_Counter;
  end record;

  type Rec_Ptr is access all Rec;

  Empty_Rec : aliased Rec;

  type T is new Ada.Finalization.Controlled with record
    Ref : Rec_Ptr := Empty_Rec'Access;
  end record;

  overriding procedure Adjust (Object : in out T);

  Empty : constant T := (Ada.Finalization.Controlled with Ref => Empty_Rec'Access);

  type Arr is array (Integer range 1 .. 8, Integer range 1 .. 4) of T;

end Opt75_Pkg;