Browse Source

* made test compilable if no floating point type support is available

florian 3 years ago
parent
commit
c4e85e5d2c
2 changed files with 17 additions and 0 deletions
  1. 5 0
      tests/test/cg/cpudefs.inc
  2. 12 0
      tests/test/cg/tcalcla1.pp

+ 5 - 0
tests/test/cg/cpudefs.inc

@@ -13,3 +13,8 @@
     {$hugecode on}
   {$endif}
 {$endif}
+
+{$ifdef cpuavr}
+{$else cpuavr}
+{$define cpuhasfloats}
+{$endif cpuavr}

+ 12 - 0
tests/test/cg/tcalcla1.pp

@@ -39,8 +39,10 @@ program tcalcla1;
    RESULT_U16BIT = 2*RESULT_U8BIT;
    RESULT_S32BIT = $500F0000;
    RESULT_S64BIT = $500F0000;
+{$ifdef cpuhasfloats}   
    RESULT_S32REAL = 1777.12;
    RESULT_S64REAL = 3444.24;
+{$endif cpuhasfloats}   
    RESULT_BOOL8BIT = 1;
    RESULT_BOOL16BIT = 1;
    RESULT_BOOL32BIT = 1;
@@ -78,8 +80,10 @@ program tcalcla1;
   global_u8bit : byte;
   global_u16bit : word;
   global_s32bit : longint;
+{$ifdef cpuhasfloats}   
   global_s32real : single;
   global_s64real : double;
+{$endif cpuhasfloats}   
   global_ptr : pchar;
   global_proc : tprocedure;
   global_bigstring : shortstring;
@@ -91,8 +95,10 @@ program tcalcla1;
   value_u8bit : byte;
   value_u16bit : word;
   value_s32bit : longint;
+{$ifdef cpuhasfloats}   
   value_s32real : single;
   value_s64real  : double;
+{$endif cpuhasfloats}   
   value_proc : tprocedure;
   value_ptr : pchar;
   value_smallrec : tsmallrecord;
@@ -117,8 +123,10 @@ program tcalcla1;
        global_u8bit := 0;
        global_u16bit := 0;
        global_s32bit := 0;
+{$ifdef cpuhasfloats}   
        global_s32real := 0.0;
        global_s64real := 0.0;
+{$endif cpuhasfloats}   
        global_ptr := nil;
        global_proc := nil;
        global_bigstring := '';
@@ -133,8 +141,10 @@ program tcalcla1;
        value_u8bit := 0;
        value_u16bit := 0;
        value_s32bit := 0;
+{$ifdef cpuhasfloats}   
        value_s32real := 0.0;
        value_s64real  := 0.0;
+{$endif cpuhasfloats}   
        value_proc := nil;
        value_ptr := nil;
        fillchar(value_smallrec, sizeof(value_smallrec), #0);
@@ -146,7 +156,9 @@ program tcalcla1;
        fillchar(value_smallarray, sizeof(value_smallarray), #0);
        value_boolean := false;
        value_char:=#0;
+{$ifdef FPC_HAS_FEATURE_ANSISTRINGS}   
        value_ansistring := '';
+{$endif FPC_HAS_FEATURE_ANSISTRINGS}   
        value_s64bit := 0;
       end;