mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-06-09 15:58:37 +02:00
* transform into a real test that fails if wrong code is generated
This commit is contained in:
parent
0c0fdec501
commit
9abb839d34
@ -4,23 +4,38 @@
|
|||||||
{ Submitted by "Maxim Voronov" on 2002-10-03 }
|
{ Submitted by "Maxim Voronov" on 2002-10-03 }
|
||||||
{ e-mail: m_v_voronov@mail.ru }
|
{ e-mail: m_v_voronov@mail.ru }
|
||||||
|
|
||||||
{$asmmode intel}
|
Program test;
|
||||||
|
|
||||||
Function TestProc:single;
|
{$asmmode intel}
|
||||||
begin
|
Function GetXminusYintel(x,y : extended):extended; assembler;
|
||||||
asm
|
asm
|
||||||
push eax
|
fld x
|
||||||
fldz
|
fld y
|
||||||
fldz
|
fsubp st(1),st(0)
|
||||||
fldz
|
|
||||||
fsubp st(2),st(0)
|
|
||||||
fstp st(0)
|
|
||||||
pop eax
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
{$asmmode att}
|
||||||
|
Function GetXminusYatt(x,y : extended):extended; assembler;
|
||||||
|
asm
|
||||||
|
fld y
|
||||||
|
fld x
|
||||||
|
fsubp %st,%st(1)
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
var
|
||||||
|
eatt,eintel : extended;
|
||||||
|
|
||||||
Begin
|
Begin
|
||||||
writeln;
|
writeln;
|
||||||
writeln(TestProc);
|
|
||||||
|
eintel:= GetXminusYintel(2.0,1.0);
|
||||||
|
writeln(eintel);
|
||||||
|
eatt:= GetXminusYatt(2.0,1.0);
|
||||||
|
writeln(eatt);
|
||||||
|
if eintel<>eatt then
|
||||||
|
begin
|
||||||
|
writeln('intel fsubp is not translated properly into fsubrp');
|
||||||
|
halt(1);
|
||||||
|
end;
|
||||||
End.
|
End.
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user