* x86: Added two new tests for i39922

This commit is contained in:
J. Gareth "Curious Kit" Moreton 2022-10-13 22:27:31 +01:00 committed by FPK
parent c89848a00f
commit 6b77017cb9
2 changed files with 35 additions and 0 deletions

31
tests/webtbs/tw39922.pp Normal file
View File

@ -0,0 +1,31 @@
{ %OPT=-O3 }
{ Test triggers "mov $0,%reg" being inserted on the wrong side of a SETcc instruction }
program tw39922.pp;
{$mode objfpc}
uses sysutils;
function isAlpha(c : Byte): Integer;
begin
if ((AnsiChar(c) >= 'A') and (AnsiChar(c) <= 'Z')) or
((AnsiChar(c) >= 'a') and (AnsiChar(c) <= 'z'))
then
Result := 1
else
Result := 0;
end;
begin
if (isAlpha(Byte('u')) = 0) then
Halt(1);
if (isAlpha(Byte('A')) = 0) then
Halt(2);
if (isAlpha(Byte('2')) = 1) then
Halt(3);
WriteLn('ok');
end.

4
tests/webtbs/tw39922a.pp Normal file
View File

@ -0,0 +1,4 @@
{ %OPT=-O3 -Os }
{ Test ensures the -Os version of "J(c)Mov1Jmp/RetMov0Jmp/Ret -> Set(~c)Jmp/Ret" is performed correctly }
{$I tw39922.pp}