* New test to catch i39851

This commit is contained in:
J. Gareth "Curious Kit" Moreton 2022-07-30 18:49:21 +01:00 committed by FPK
parent b1e65ca49f
commit 8ba76f7d0a

28
tests/webtbs/tw39851.pp Normal file
View File

@ -0,0 +1,28 @@
{ %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.