--  A postcondition reading `C.V'Old` through an access value is checked at run time with
--  the value C.V had on entry (Ada's `X'Old`), not with a copy of the access value.
with Ada.Text_IO;
with Ada.Unchecked_Deallocation;
procedure Main is
   type Cell is record
      V : Integer;
   end record;
   type Cell_Ptr is access Cell;
   procedure Free is new Ada.Unchecked_Deallocation (Cell, Cell_Ptr);
   --  wrong on purpose: the postcondition says V grows by 2, the body adds 1
   procedure Bump (C : Cell_Ptr)
     with Pre => C /= null and then C.V < 100,
          Post => C.V = C.V'Old + 2
   is
   begin
      C.V := C.V + 1;
   end Bump;
   P : Cell_Ptr := new Cell'(V => 1);
begin
   Bump (P);
   Ada.Text_IO.Put_Line (Integer'Image (P.V));
   Free (P);
end Main;
