瀏覽代碼

test extended

pierre 25 年之前
父節點
當前提交
8c94e449ae
共有 1 個文件被更改,包括 31 次插入3 次删除
  1. 31 3
      tests/test/testfdiv.pp

+ 31 - 3
tests/test/testfdiv.pp

@@ -11,8 +11,16 @@
     The ATT read
       fdiv %st,%st(1)
     as
-      st(1):=st/st(1) }
-
+      st(1):=st/st(1)
+    Should be tested with
+    different output styles :
+    for go32v2
+      -Aas -Acoff and -Anasmcoff
+    for win32
+      -Aas -Apecoff and -Anasmwin32
+    for linux
+      -Aas and -Anasmelf
+    }
 
 program  test_nasm_div;
 
@@ -46,6 +54,15 @@ begin
   Writeln('ATT result of 4/2=',z:0:2);
   if z <> 2.0 then
     Halt(1);
+  asm
+    fldl y
+    fldl x
+    fadd
+    fstpl z
+  end;
+  Writeln('ATT result of 4+2=',z:0:2);
+  if z <> 6.0 then
+    Halt(1);
 {$asmmode intel}
   asm
     fld x
@@ -66,5 +83,16 @@ begin
   Writeln('Intel result of 4/2=',z:0:2);
   if z <> 2.0 then
     Halt(1);
+  asm
+    fld y
+    fld x
+    fadd
+    fstp z
+  end;
+  Writeln('Intel result of 4+2=',z:0:2);
+  if z <> 6.0 then
+    Halt(1);
+
   Writeln('All tests completed successfully!');
-end.
+end.
+