fpc/tests/webtbs/tw4152.pp
2005-12-20 08:11:59 +00:00

19 lines
384 B
ObjectPascal

{ Source provided for Free Pascal Bug Report 4152 }
{ Submitted by "C Western" on 2005-07-03 }
{ e-mail: mftq75@dsl.pipex.com }
{$R+}{$Q+}
var
p:^Byte;
c:Byte;
d:Integer;
v : cardinal;
begin
v:=100;
inc(v,-1);
p:=@c;
Inc(p,-1); // Gives compile time error: range check error while evaluating constants
d:=2;
Inc(d,-1);
Inc(p,d); // This fails at run time
end.