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

{$d+}
program d051( 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 {d051}

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

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

