From a573aff1a25ffc62556a13d300109e1f422fb4fb Mon Sep 17 00:00:00 2001 From: pierre Date: Tue, 4 Apr 2000 11:38:10 +0000 Subject: [PATCH] Check conversion of integer FPU instructions --- tests/test/testfpu.pp | 59 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 59 insertions(+) create mode 100644 tests/test/testfpu.pp diff --git a/tests/test/testfpu.pp b/tests/test/testfpu.pp new file mode 100644 index 0000000000..ff82b497a8 --- /dev/null +++ b/tests/test/testfpu.pp @@ -0,0 +1,59 @@ +program test_fp_instructions; + + + function test : extended; + + var + x,y : integer; + z,t : longint; + a,b,c : comp; + begin + x:=5; + c:=5; + t:=5; + z:=4; + a:=20; +{$asmmode att} + asm + fildl z + fimuls x + fistpq b + end; + if a<>b then + begin + Writeln('Error in FPU att syntax code generation'); + Halt(1); + end; + asm + fildl z + fimull t + fistpq b + end; + if a<>b then + begin + Writeln('Error in FPU att syntax code generation'); + Halt(1); + end; +{$asmmode intel} + asm + fild dword ptr z + fimul dword ptr t + fistp qword ptr b + fild dword ptr z + fimul word ptr x + fistp qword ptr b + end; + if a<>b then + begin + Writeln('Error in FPU code generation'); + Halt(1); + end; + test:=b; + end; + +var + z : extended; + +begin + z:=test; +end. \ No newline at end of file