Test suite results for test file test/cg/tfuncret.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/tfuncret.pp" information:

t_id 182
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 5 10.0 2024/10/19 09:39:00 55 2024/10/19 11:13:00 63
m68k 2 4.0 2024/10/19 07:29:00 50 2024/10/19 10:22:00 40
sparc 3 6.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 13:26:00 65
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 10 20.0 2024/10/19 08:43:00 65 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 1 2.0 2024/10/19 09:59:00 38 2024/10/19 09:59:00 38
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 1 2.0 2024/10/19 09:45:00 25 2024/10/19 09:45:00 25
linux 33 66.0 2024/10/19 07:29:00 50 2024/10/19 11:38:00 25
go32v2 3 6.0 2024/10/19 09:39:00 55 2024/10/19 11:13:00 63
solaris 5 10.0 2024/10/19 13:22:00 24 2024/10/19 13:36:00 24
aix 9 18.0 2024/10/19 08:40:00 51 2024/10/19 13:26:00 65
3.3.1 31 62.0 2024/10/19 08:05:00 45 2024/10/19 13:26:00 65
3.2.3 19 38.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 : secondfuncret()                                  }
{****************************************************************}
{ DEFINES:                                                       }
{            FPC     = Target is FreePascal compiler             }
{****************************************************************}
{ REMARKS : Tested with Delphi 3 as reference implementation     }
{****************************************************************}
program tfuncret;

{$ifdef ver70}
{$define tp}
{$endif}

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


  RESULT_S64BIT = -12;
  RESULT_S32BIT = -124356;
  RESULT_U32BIT = 654321;
  RESULT_U8BIT  = $55;
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;

{****************************************************************}
{                         SIMPLE CASE                            }
{****************************************************************}

    function getresult_simple_s64bit: int64;
      var
       s64bit : int64;
       i: integer;
      begin
        getresult_simple_s64bit := 0;
        s64bit:=RESULT_S64BIT;
        getresult_simple_s64bit := s64bit;
      end;


    function getresult_simple_s32bit: longint;
      var
       s32bit : longint;
       i: longint;
      begin
        getresult_simple_s32bit := 0;
        i:=1;
        i:=i*RESULT_S32BIT div i;
        s32bit:=i;
        getresult_simple_s32bit := s32bit;
      end;


    function getresult_simple_bigrecord : tbigrecord;
     var
      localbigrecord : tbigrecord;
      i: integer;
     begin
      localbigrecord.x := RESULT_U32BIT;
      localbigrecord.y := RESULT_U32BIT;
      for i:=0 to MAX_INDEX do
        localbigrecord.z[i] := RESULT_U8BIT;
      getresult_simple_bigrecord := localbigrecord;
     end;

{****************************************************************}
{                         WITH NESTING                           }
{****************************************************************}

    function getresult_nested_s64bit: int64;

      procedure nested_one;
      var
       s64bit : int64;
       i: longint;
      begin
        getresult_nested_s64bit := 0;
        s64bit:=RESULT_S64BIT;
        getresult_nested_s64bit := s64bit;
      end;

    begin
      nested_one;
    end;


    function getresult_nested_s32bit: longint;


      procedure nested_one;
      var
       s32bit : longint;
       i: longint;
      begin
        getresult_nested_s32bit := 0;
        i:=1;
        i:=i*RESULT_S32BIT div i;
        s32bit:=i;
        getresult_nested_s32bit := s32bit;
      end;

    begin
      nested_one;
    end;


    function getresult_nested_bigrecord : tbigrecord;

       procedure nested_one;
        var
         localbigrecord : tbigrecord;
         i: longint;
       begin
         localbigrecord.x := RESULT_U32BIT;
         localbigrecord.y := RESULT_U32BIT;
         for i:=0 to MAX_INDEX do
           localbigrecord.z[i] := RESULT_U8BIT;
         getresult_nested_bigrecord := localbigrecord;
       end;

     begin
       nested_one;
     end;


{****************************************************************}
{                     WITH COMPLEX NESTING                       }
{****************************************************************}

    function getresult_nested_complex_s64bit: int64;

      procedure nested_one;
      var
       s64bit : int64;
       i: integer;

       function nested_two: int64;
        begin
         nested_two:=0;
         getresult_nested_complex_s64bit := 0;
         s64bit:=RESULT_S64BIT;
         getresult_nested_complex_s64bit := s64bit;
        end;

      begin
        nested_two;
      end;

    begin
      nested_one;
    end;


    function getresult_nested_complex_s32bit: longint;


      procedure nested_one;
      var
       s32bit : longint;
       i: longint;

       function nested_two: longint;
         begin
           nested_two := 0;
           getresult_nested_complex_s32bit := 0;
           i:=1;
           i:=i*RESULT_S32BIT div i;
           s32bit:=i;
           getresult_nested_complex_s32bit := s32bit;
         end;

      begin
        nested_two;
      end;

    begin
      nested_one;
    end;


    function getresult_nested_complex_bigrecord : tbigrecord;

       procedure nested_one;
        var
         localbigrecord : tbigrecord;

         function nested_two : tbigrecord;
           var
            i : integer;
           begin
            nested_two := localbigrecord;
            localbigrecord.x := RESULT_U32BIT;
            localbigrecord.y := RESULT_U32BIT;
            for i:=0 to MAX_INDEX do
               localbigrecord.z[i] := RESULT_U8BIT;
            getresult_nested_complex_bigrecord := localbigrecord;
           end;

       begin
         nested_two;
       end;

     begin
       nested_one;
     end;


var
 failed : boolean;
 bigrecord : tbigrecord;
 i: integer;
Begin
  Write('secondfuncret simple case tests...');
  failed := false;
  if getresult_simple_s64bit <> RESULT_S64BIT then
    failed := true;
  if getresult_simple_s32bit <> RESULT_S32BIT then
    failed := true;
  bigrecord := getresult_simple_bigrecord;
  if bigrecord.x <> RESULT_U32BIT then
    failed := true;
  if bigrecord.y <> RESULT_U32BIT then
    failed := true;
  for i:=0 to MAX_INDEX do
    begin
       if bigrecord.z[i] <> RESULT_U8BIT then
         begin
           failed := true;
           break;
         end;
    end;


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

  Write('secondfuncret simple nesting case tests...');
  failed := false;
  if getresult_nested_s64bit <> RESULT_S64BIT then
    failed := true;
  if getresult_nested_s32bit <> RESULT_S32BIT then
    failed := true;

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


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

  Write('secondfuncret complex nesting case tests...');
  failed := false;
  if getresult_nested_complex_s64bit <> RESULT_S64BIT then
    failed := true;
  if getresult_nested_complex_s32bit <> RESULT_S32BIT then
    failed := true;

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


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

end.

{
  $Log: tfuncret.pp,v $
  Revision 1.2  2002/09/07 15:40:56  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/tfuncret.pp source.