Test suite results for test file test/cg/tassign2.pp

Test run data :

Free Pascal Compiler Test Suite Results

View Test suite results

Please specify search criteria:
File:
Operating system:
Processor:
Version
Date
Submitter
Machine
Comment
Limit
Cond
Category
Only failed tests
Hide skipped tests
List all tests

Test file "test/cg/tassign2.pp" information:

t_id 108
t_adddate 2003/10/03
t_result 0
t_knownrunerror 0

Detailed test run results:

Record count: 50

Total = 50

OK=50 Percentage= 100.00

Result type Cat. Count Percentage First date Last Date
Successfully run 50 100.0 2024/10/19 07:29:00 50 2024/10/19 13:36:00 24
i386 4 8.0 2024/10/19 09:39:00 55 2024/10/19 11:13:00 63
m68k 3 6.0 2024/10/19 07:29:00 50 2024/10/19 10:22:00 40
sparc 4 8.0 2024/10/19 08:05:00 45 2024/10/19 11:16:00 40
powerpc 6 12.0 2024/10/19 08:40:00 51 2024/10/19 12:56:00 67
arm 2 4.0 2024/10/19 09:36:00 32 2024/10/19 10:03:00 32
x86_64 9 18.0 2024/10/19 08:27:00 30 2024/10/19 13:36:00 24
powerpc64 7 14.0 2024/10/19 10:06:00 62 2024/10/19 11:23:00 69
mips 2 4.0 2024/10/19 09:54:00 35 2024/10/19 10:28:00 38
mipsel 2 4.0 2024/10/19 09:59:00 38 2024/10/19 10:35:00 142
aarch64 4 8.0 2024/10/19 08:15:00 27 2024/10/19 09:57:00 26
sparc64 3 6.0 2024/10/19 09:25:00 118 2024/10/19 11:33:00 117
riscv64 2 4.0 2024/10/19 10:25:00 33 2024/10/19 11:10:00 26
loongarch64 2 4.0 2024/10/19 09:45:00 25 2024/10/19 10:17:00 30
linux 34 68.0 2024/10/19 07:29:00 50 2024/10/19 11:33:00 117
go32v2 3 6.0 2024/10/19 09:39:00 55 2024/10/19 11:13:00 63
solaris 6 12.0 2024/10/19 13:22:00 24 2024/10/19 13:36:00 24
aix 7 14.0 2024/10/19 08:40:00 51 2024/10/19 12:56:00 67
3.3.1 33 66.0 2024/10/19 08:05:00 45 2024/10/19 12:56:00 67
3.2.3 17 34.0 2024/10/19 07:29:00 50 2024/10/19 13:36:00 24

Source:

{****************************************************************}
{  CODE GENERATOR TEST PROGRAM                                   }
{  By Carl Eric Codere                                           }
{****************************************************************}
{ NODE TESTED : secondassign()                                   }
{****************************************************************}
{ DEFINES:                                                       }
{            FPC     = Target is FreePascal compiler             }
{****************************************************************}
{ REMARKS : Tested with Delphi 3 as reference implementation     }
{****************************************************************}
program tassign2;

{$ifdef fpc}
{$warning Will only work on 32-bit cpu's}
{$mode objfpc}
{$endif}

const
  RESULT_STRING = 'Hello world';
  RESULT_S64BIT = -12;
  RESULT_S32BIT = -124356;
  RESULT_U32BIT = 654321;
  RESULT_U8BIT  = $55;
  RESULT_S16BIT = -12124;
  RESULT_REAL   = 12.12;

  { adjusts the size of the bigrecord }
  MAX_INDEX = 7;

type
  {
    the size of this record should *at least* be the size
    of a natural register for the target processor
  }
  tbigrecord = record
   x : cardinal;
   y : cardinal;
   z : array[0..MAX_INDEX] of byte;
  end;


    procedure fail;
    begin
      WriteLn('Failure.');
      halt(1);
    end;



    function getresults64bit: int64;
     begin
       getresults64bit := RESULT_S64BIT;
     end;

    function getresults32bit : longint;
     begin
       getresults32bit := RESULT_S32BIT;
     end;

    function getresultu8bit : byte;
      begin
        getresultu8bit := RESULT_U8BIT;
      end;

    function getresults16bit : smallint;
      begin
        getresults16bit := RESULT_S16BIT;
      end;

    function getresultreal : real;
      begin
        getresultreal := RESULT_REAL;
      end;

var
 failed : boolean;
 s64bit : int64;
 s32bit : longint;
 s16bit : smallint;
 u8bit : byte;
 boolval : boolean;
 real_val : real;
 bigrecord1, bigrecord2 : tbigrecord;
 i: integer;
Begin
  WriteLn('secondassign node testing.');
  failed := false;
  { possibilities : left : any, right : LOC_REFERENCE, LOC_REGISTER,
    LOC_FPUREGISTER, LOC_CONSTANT, LOC_JUMP and LOC_FLAGS }
  Write('left : LOC_REFERENCE, right : LOC_CONSTANT tests..');
  s64bit := RESULT_S64BIT;
  if s64bit <> RESULT_S64BIT then
    failed := true;

  s32bit := RESULT_S32BIT;
  if s32bit <> RESULT_S32BIT then
    failed := true;

  if failed then
    fail
  else
    WriteLn('Success!');

  Write('left : LOC_REFERENCE, right : LOC_REGISTER tests..');
  failed := false;

  s64bit := getresults64bit;
  if s64bit <> RESULT_S64BIT then
    failed := true;

  s32bit := getresults32bit;
  if s32bit <> RESULT_S32BIT then
    failed := true;

  s16bit := getresults16bit;
  if s16bit <> RESULT_S16BIT then
    failed := true;

  u8bit := getresultu8bit;
  if u8bit <> RESULT_U8BIT then
    failed := true;

  if failed then
    fail
  else
    WriteLn('Success!');

  Write('left : LOC_REFERENCE, right : LOC_FPUREGISTER tests..');
  failed := false;

  real_val := getresultreal;
  if trunc(real_val) <> trunc(RESULT_REAL) then
    failed := true;

  if failed then
    fail
  else
    WriteLn('Success!');

  Write('left : LOC_REFERENCE, right : LOC_REFERENCE tests..');
  failed := false;

  bigrecord1.x := RESULT_U32BIT;
  bigrecord1.y := RESULT_U32BIT;
  for i:=0 to MAX_INDEX do
    bigrecord1.z[i] := RESULT_U8BIT;

  fillchar(bigrecord2, sizeof(bigrecord2),#0);

  bigrecord2 := bigrecord1;

  if bigrecord2.x <> RESULT_U32BIT then
    failed := true;
  if bigrecord2.y <> RESULT_U32BIT then
    failed := true;
  for i:=0 to MAX_INDEX do
    begin
       if bigrecord2.z[i] <> RESULT_U8BIT then
         begin
           failed := true;
           break;
         end;
    end;


  if failed then
    fail
  else
    WriteLn('Success!');

  Write('left : LOC_REFERENCE, right : LOC_JUMP tests (32-bit cpus only!)..');
  {!!!!! This test will only work on 32-bit CPU's probably, on 64-bit CPUs
    the location should be in LOC_FLAGS
  }
  failed := false;

  s64bit := RESULT_S64BIT;
  boolval := s64bit = RESULT_S64BIT;
  if boolval = FALSE then
    failed := true;

  if failed then
    fail
  else
    WriteLn('Success!');


  Write('left : LOC_REFERENCE, right : LOC_FLAGS tests..');
  failed := false;

  s32bit := RESULT_S32BIT;
  boolval := s32bit = RESULT_S32BIT;
  if boolval = FALSE then
    failed := true;


  if failed then
    fail
  else
    WriteLn('Success!');


end.

{
  $Log: tassign2.pp,v $
  Revision 1.2  2002/09/07 15:40:49  peter
    * old logs removed and tabs fixed

  Revision 1.1  2002/08/10 08:27:43  carl
    + mre tests for cg testuit

}

Link to SVN view of test/cg/tassign2.pp source.