
{: test that chr(n) causes a fatal error if it overflows }

{$d+}
program d026( output );
const
   maxTryChar =  1000;
var
   n :  integer;
function side : integer;
begin
   side := n;
   n := n+1;
end;
begin {d026}
   n := ord( ' ');
   write( chr(n) );
   if n <> ord( ' ' )+1 then
      writeln( 'side effect error evaluating chr()' );
   while n <= maxTryChar do begin
      write( chr(n) );     { should overflow eventually }
      n := n+1;
      if (n - ord(' ')) mod 80 = 0 then
         writeln;
   end;
end. { d026 }

