--  What ACATS found wrong in run-time meaning (D199): membership in a discriminant
--  constraint (C45274C), `'Constrained` of a private type's object outside its package
--  (C74208B), a derived function hiding an enumeration literal (C83032A), a formal type's
--  discriminant naming its actual's (CC3240A), an allocator of a constrained array subtype
--  (C48006B), a loop's frame not taking an array of owning access values (C352001),
--  `'Value` in the base range (C34002A), wide characters' images (C352001), and a scalar
--  type's `Size` clause.
with Ada.Text_IO; use Ada.Text_IO;
with Ada.Unchecked_Deallocation;
procedure Main is
   package P is
      type LP (Discr : Boolean := False) is limited private;
      type Rec (D : Integer := 0) is private;
      type Enum1 is (E11, E12, E13);
      type Priv1 is private;
      function E11 return Priv1;
      function Is_E13 (X : Priv1) return Boolean;
   private
      type LP (Discr : Boolean := False) is record
         A, B : Integer;
      end record;
      type Rec (D : Integer := 0) is record
         null;
      end record;
      type Priv1 is new Enum1;
   end P;
   use P;
   subtype LPFalse is LP (False);
   X : LP (True);
   R3A : P.Rec;
   pragma Unreferenced (R3A);

   package body P is
      type NPriv1 is new Priv1;
      function E11 return Priv1 is (E13);
      function Is_E13 (X : Priv1) return Boolean is (X = E13);
   begin
      X := (True, 19, 91);
      Put_Line (Boolean'Image (NPriv1'(E11) = E13));
   end P;

   generic
      type T (A : Integer) is private;
   package G is
      function First_Discriminant (V : T) return Integer is (V.A);
   end G;
   type Pair (L : Integer) is record
      A : Integer;
   end record;
   package GP is new G (Pair);

   type Arr0 is array (Integer range <>) of Integer;
   subtype Arr is Arr0 (1 .. 4);
   type A_Arr is access Arr;
   V : A_Arr := new Arr'(5, 6, 7, 8);

   type Dyn is access String;
   type Table is array (1 .. 4) of Dyn;
   Tab : Table;

   type Parent is range -100 .. 100;
   type T30 is new Parent range -30 .. 30;

   type Small is range 0 .. 10;
   for Small'Size use 16;
   Hundred : constant String := "100";
   procedure Free is new Ada.Unchecked_Deallocation (String, Dyn);
   procedure Free is new Ada.Unchecked_Deallocation (Arr, A_Arr);
begin
   Put_Line (Boolean'Image (X in LPFalse) & " " & Boolean'Image (R3A'Constrained) & " " & Integer'Image (GP.First_Discriminant ((L => 5, A => 7))));
   Put_Line (Integer'Image (V'First) & Integer'Image (V (1)) & Integer'Image (V'Last));
   for I in 1 .. 2 loop
      Tab (I) := new String'("a" & Integer'Image (I));
      pragma Loop_Invariant (for all J in 1 .. I => Tab (J) /= null);
      pragma Loop_Invariant (for all J in I + 1 .. 4 => Tab (J) = null);
   end loop;
   for I in 3 .. 4 loop
      Tab (I) := new String'("b" & Integer'Image (I));
      pragma Loop_Invariant (for all J in 1 .. I => Tab (J) /= null);
      pragma Loop_Invariant (for all J in I + 1 .. 4 => Tab (J) = null);
   end loop;
   Put (Tab (1).all);
   Put (" ");
   Put_Line (Tab (4).all);
   if T30'Base'Valid_Value (Hundred) then
      Put (T30'Base'Image (T30'Value (Hundred)));
   end if;
   Put_Line (" " & Wide_Character'Image (Wide_Character'First) & " " & Wide_Character'Image (Wide_Character'Last) & Integer'Image (Small'Size));
   Free (Tab (1));
   Free (Tab (2));
   Free (Tab (3));
   Free (Tab (4));
   Free (V);
end Main;
