procedure Main is
   function Sum (N : Natural) return Natural
     with Subprogram_Variant => (Decreases => N),
          Pre => N <= 100
   is
   begin
      if N = 0 or N = 100 then
         return 0;
      else
         return Sum (N + 1);
      end if;
   end Sum;
   S : constant Natural := Sum (3);
begin
   null;
end Main;
