Browse Source

+ also test qword->float conversion

git-svn-id: trunk@12529 -
Jonas Maebe 17 years ago
parent
commit
6e1dc583b2
1 changed files with 15 additions and 1 deletions
  1. 15 1
      tests/test/cg/tcnvint4.pp

+ 15 - 1
tests/test/cg/tcnvint4.pp

@@ -37,7 +37,8 @@ end;
 
 
 const
- RESULT_S64BIT            =   101234;
+ RESULT_U64BIT            =  qword($8fe0000000000000);
+ RESULT_S64BIT            =  -101234;
  RESULT_S32BIT            = -1000000;
  RESULT_U32BIT            =  2000000;
  RESULT_S16BIT            =   -12123;
@@ -51,6 +52,11 @@ const
     begin
       gets64bit := RESULT_S64BIT;
     end;
+
+   function getu64bit : qword;
+    begin
+      getu64bit := RESULT_U64BIT;
+    end;
 {$endif}
 
    function gets32bit : longint;
@@ -153,6 +159,14 @@ begin
   if trunc(result_val) <> RESULT_S64BIT then
      failed:=true;
 
+  result_val := getu64bit;
+  if result_val <> 10367286342206881792.0 then
+    begin
+      writeln('got ',result_val:0);
+      writeln('expected ',10367286342206881792.0);
+     failed:=true;
+    end;
+
   result_val := gets32bit;
   if trunc(result_val) <> RESULT_S32BIT then
      failed:=true;