
{: test that the pack function causes a fatal error if there is a range error}

{$d+}
program d050( output );

var
   a  : array['a'..'z'] of 'a'..'z';
   pa : packed array[1..4] of char;
   c  : char;

function side : char;
begin
   side := c;
   c := succ(c);
end;
begin {d050}

   c := 'w';
   pack( a, side, pa );
   if c <> 'x' then
      writeln( 'pack for debug has side effects' );

   pack( a, 'x', pa ); { range error }
   writeln( 'fails: pack range error not detected' );
end. { d050 }

