mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-09-12 03:30:20 +02:00
* x86: Added two new tests for i39922
This commit is contained in:
parent
c89848a00f
commit
6b77017cb9
31
tests/webtbs/tw39922.pp
Normal file
31
tests/webtbs/tw39922.pp
Normal 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
4
tests/webtbs/tw39922a.pp
Normal 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}
|
Loading…
Reference in New Issue
Block a user