--  A constraint's bounds are those its declaration's elaboration gives (RM 3.2.2(10),
--  3.6.1(8)): a variable a bound names, changed later, changes neither the subtype nor an
--  object's bounds (they were evaluated again where they were used).
with Ada.Text_IO;
procedure Main is
   N : Integer := 5;
   subtype Small is Integer range 1 .. N;
   subtype Line is String (1 .. N);
   X : Small := 5;
   L : Line := "abcde";
   Count : Natural := 0;
begin
   N := 2;
   X := 4;
   L := "vwxyz";
   Ada.Text_IO.Put_Line (Integer'Image (Small'Last) & Integer'Image (Line'Last) & Integer'Image (X) & " " & L);
   for I in Small loop
      pragma Loop_Invariant (Count = I - 1);
      Count := Count + 1;
   end loop;
   Ada.Text_IO.Put_Line (Integer'Image (Count) & Integer'Image (N));
end Main;
