fpc/tests/webtbs/tw39851.pp
J. Gareth "Curious Kit" Moreton 8ba76f7d0a * New test to catch i39851
2022-07-31 19:45:23 +00:00

29 lines
360 B
ObjectPascal

{ %OPT=-O1 -OoPEEPHOLE }
{$mode delphi}
{$C+}
program tw39851;
function Fn1: Boolean;
begin
Result := True;
end;
procedure TestCmpErr;
var
I: Integer;
begin
I := 0;
if (I < 0) or (not Fn1()) then
begin // this branch should NOT be executed
ASSERT((I <= 0) and (not Fn1()));
Halt(1);
end;
end;
begin
TestCmpErr;
WriteLn('ok');
end.