Browse Source

* New test to catch i39851

J. Gareth "Curious Kit" Moreton 3 years ago
parent
commit
8ba76f7d0a
1 changed files with 28 additions and 0 deletions
  1. 28 0
      tests/webtbs/tw39851.pp

+ 28 - 0
tests/webtbs/tw39851.pp

@@ -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.