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

Test run data :

Run ID:
Operating system: linux
Processor: i386
Version: 3.2.3
Fails/OK/Total: 43/8311/8354
Version: 3.2.3
Full version: 3.2.3-1373-gae0fe8a6a0
Comment: -XR/home/pierre/sys-root/i386-linux -Xd -Xr/home/pierre/sys-root/i386-linux
Machine: gcclocal
Category: 1
SVN revisions: fdf93c5b29:c17a0e20f5:ae0fe8a6a0:d1c29e6cb9
Submitter: pierre
Date: 2024/04/19 10:37:00 <> 2024/04/09
Previous run: 934296
Next run: 935632

Hide skipped tests

Hide successful tests

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

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

Detailed test run results:

tr_idruntr_oktr_skiptr_result
443641062934966TrueFalseSuccessfully run

Record count: 1

No log of 934966.

Source:

{****************************************************************}
{  CODE GENERATOR TEST PROGRAM                                   }
{****************************************************************}
{ NODE TESTED : secondfor()                                      }
{****************************************************************}
{ PRE-REQUISITES: secondload()                                   }
{                 secondassign()                                 }
{                 secondcalln()                                  }
{                 secondinline()                                 }
{                 secondadd()                                    }
{****************************************************************}
{ DEFINES:                                                       }
{****************************************************************}
{ REMARKS:                                                       }
{****************************************************************}
program tfor;

const LOOP_NUMS = 100;

{$ifndef fpc}
  type cardinal = longint;
{$endif}

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


function getupper : longint;
 begin
   getupper:=LOOP_NUMS;
 end;

function getupper0: longint;
 begin
   getupper0 := 1;
 end;

{$ifdef fpc}
function getupper64 : int64;
 begin
   getupper64:=1;
 end;

function getupper64high : int64;
 begin
   getupper64high:=LOOP_NUMS;
 end;

{$endif}


var
  index_signed: longint;
  index_unsigned : cardinal;
  count:longint;
  count1 : longint;
  loop_count : longint;
  failed : boolean;

{$ifdef fpc}
  index64 : int64;
  count64 : int64;
  count642 : int64;
{$endif}
begin
  loop_count:=0;
  count := LOOP_NUMS;
  count1 := LOOP_NUMS;
  { SIGNED INDEX }
  failed := false;
  Write('Signed index for loop testing (forward)...');
  { lowerbound : constant        }
  { upper bound :: LOC_REFERENCE }
  for index_signed:=1 to count do
    loop_count:=loop_count+1;
  if loop_count <> LOOP_NUMS then
    failed := true;
  { upper bound : LOC_REGISTER  }
  loop_count:=0;
  for index_signed:=1 to getupper do
     loop_count:=loop_count+1;
  if loop_count <> LOOP_NUMS then
    failed := true;
  { upper bound : LOC_CONSTANT }
  loop_count:=0;
  for index_signed:=1 to LOOP_NUMS do
     loop_count:=loop_count+1;
  if loop_count <> LOOP_NUMS then
    failed := true;
  { lowerbound : LOC_REFERENCE }
  { upper bound : constant     }
  count:=1;
  loop_count:=0;
  for index_signed:=count to LOOP_NUMS do
    loop_count:=loop_count+1;
  if loop_count <> LOOP_NUMS then
    failed := true;
  { upper bound : LOC_REGISTER }
  loop_count:=0;
  for index_signed:=count to getupper do
    loop_count:=loop_count+1;
  if loop_count <> LOOP_NUMS then
    failed := true;
  { upper bound : LOC_REFERENCE }
  loop_count:=0;
  for index_signed:=count to count1 do
    loop_count:=loop_count+1;
  if loop_count <> LOOP_NUMS then
    failed := true;


  { lowerbound : LOC_REGISTER }
  { upper bound : constant     }
  count:=0;
  loop_count:=0;
  for index_signed:=getupper0 to LOOP_NUMS do
    loop_count:=loop_count+1;
  if loop_count <> LOOP_NUMS then
    failed := true;
  { upper bound : LOC_REGISTER }
  loop_count:=0;
  for index_signed:=getupper0 to getupper do
    loop_count:=loop_count+1;
  if loop_count <> LOOP_NUMS then
    failed := true;
  { upper bound : LOC_REFERENCE }
  loop_count:=0;
  for index_signed:=getupper0 to count1 do
    loop_count:=loop_count+1;
  if loop_count <> LOOP_NUMS then
    failed := true;
  if failed then
    fail
  else
    WriteLn('Passed!');


  { UNSIGNED INDEX }
  Write('Unsigned index for loop testing (forward)...');
  loop_count:=0;
  failed := false;
  count := LOOP_NUMS;
  count1 := LOOP_NUMS;
  { lowerbound : constant        }
  { upper bound :: LOC_REFERENCE }
  for index_unsigned:=1 to count do
    loop_count:=loop_count+1;
  if loop_count <> LOOP_NUMS then
    failed := true;
  { upper bound : LOC_REGISTER  }
  loop_count:=0;
  for index_unsigned:=1 to getupper do
     loop_count:=loop_count+1;
  if loop_count <> LOOP_NUMS then
    failed := true;
  { upper bound : LOC_CONSTANT }
  loop_count:=0;
  for index_unsigned:=1 to LOOP_NUMS do
     loop_count:=loop_count+1;
  if loop_count <> LOOP_NUMS then
    failed := true;

  { lowerbound : LOC_REFERENCE }
  { upper bound : constant     }
  count:=1;
  loop_count:=0;
  for index_unsigned:=count to LOOP_NUMS do
    loop_count:=loop_count+1;
  if loop_count <> LOOP_NUMS then
    failed := true;
  { upper bound : LOC_REGISTER }
  loop_count:=0;
  for index_unsigned:=count to getupper do
    loop_count:=loop_count+1;
  if loop_count <> LOOP_NUMS then
    failed := true;
  { upper bound : LOC_REFERENCE }
  loop_count:=0;
  for index_unsigned:=count to count1 do
    loop_count:=loop_count+1;
  if loop_count <> LOOP_NUMS then
    failed := true;


  { lowerbound : LOC_REGISTER }
  { upper bound : constant     }
  count:=0;
  loop_count:=0;
  for index_unsigned:=getupper0 to LOOP_NUMS do
    loop_count:=loop_count+1;
  if loop_count <> LOOP_NUMS then
    failed := true;
  { upper bound : LOC_REGISTER }
  loop_count:=0;
  for index_unsigned:=getupper0 to getupper do
    loop_count:=loop_count+1;
  if loop_count <> LOOP_NUMS then
    failed := true;
  { upper bound : LOC_REFERENCE }
  loop_count:=0;
  for index_unsigned:=getupper0 to count1 do
    loop_count:=loop_count+1;
  if loop_count <> LOOP_NUMS then
    failed := true;
  if failed then
    fail
  else
    WriteLn('Passed!');

(*  UNSUPPORTED IN FPC VERSION 1.0.x (CEC)
  { --------------------- int64 testing!------------------- }
  WriteLn('int64 testing...');
  loop_count:=0;
  count64 := LOOP_NUMS;
  count1 := LOOP_NUMS;
  { SIGNED INDEX }
  failed := false;
  { lowerbound : constant        }
  { upper bound :: LOC_REFERENCE }
  for index64:=1 to count64 do
    loop_count:=loop_count+1;
  if loop_count <> LOOP_NUMS then
    failed := true;
  { upper bound : LOC_REGISTER  }
  loop_count:=0;
  for index64:=1 to getupper64high do
     loop_count:=loop_count+1;
  if loop_count <> LOOP_NUMS then
    failed := true;
  { upper bound : LOC_CONSTANT }
  loop_count:=0;
  for index64:=1 to LOOP_NUMS do
     loop_count:=loop_count+1;
  if loop_count <> LOOP_NUMS then
    failed := true;
  { lowerbound : LOC_REFERENCE }
  { upper bound : constant     }
  count64:=1;
  count642:=LOOP_NUMS;
  loop_count:=0;
  for index64:=count64 to LOOP_NUMS do
    loop_count:=loop_count+1;
  if loop_count <> LOOP_NUMS then
    failed := true;
  { upper bound : LOC_REGISTER }
  loop_count:=0;
  for index64:=count64 to getupper64high do
    loop_count:=loop_count+1;
  if loop_count <> LOOP_NUMS then
    failed := true;
  { upper bound : LOC_REFERENCE }
  loop_count:=0;
  for index64:=count64 to count642 do
    loop_count:=loop_count+1;
  if loop_count <> LOOP_NUMS then
    failed := true;


  { lowerbound : LOC_REGISTER }
  { upper bound : constant     }
  count64:=LOOP_NUMS;
  loop_count:=0;
  for index64:=getupper64 to LOOP_NUMS do
    loop_count:=loop_count+1;
  if loop_count <> LOOP_NUMS then
    failed := true;
  { upper bound : LOC_REGISTER }
  loop_count:=0;
  for index64:=getupper64 to getupper64high do
    loop_count:=loop_count+1;
  if loop_count <> LOOP_NUMS then
    failed := true;
  { upper bound : LOC_REFERENCE }
  loop_count:=0;
  for index64:=getupper64 to count64 do
    loop_count:=loop_count+1;
  if loop_count <> LOOP_NUMS then
    failed := true;
  if failed then
    fail
  else
    WriteLn('Passed!');
*)

  loop_count:=0;
  count := LOOP_NUMS;
  count1 := LOOP_NUMS;
  { SIGNED INDEX }
  failed := false;
  Write('Signed index for loop testing (backward)...');
  { lowerbound : constant        }
  { upper bound :: LOC_REFERENCE }
  for index_signed:=count downto 1 do
    loop_count:=loop_count+1;
  if loop_count <> LOOP_NUMS then
    failed := true;
  { upper bound : LOC_REGISTER  }
  loop_count:=0;
  for index_signed:=getupper downto 1 do
     loop_count:=loop_count+1;
  if loop_count <> LOOP_NUMS then
    failed := true;
  { upper bound : LOC_CONSTANT }
  loop_count:=0;
  for index_signed:=LOOP_NUMS  downto 1 do
     loop_count:=loop_count+1;
  if loop_count <> LOOP_NUMS then
    failed := true;
  { lowerbound : LOC_REFERENCE }
  { upper bound : constant     }
  count:=1;
  loop_count:=0;
  for index_signed:=LOOP_NUMS downto count do
    loop_count:=loop_count+1;
  if loop_count <> LOOP_NUMS then
    failed := true;
  { upper bound : LOC_REGISTER }
  loop_count:=0;
  for index_signed:=getupper downto count do
    loop_count:=loop_count+1;
  if loop_count <> LOOP_NUMS then
    failed := true;
  { upper bound : LOC_REFERENCE }
  loop_count:=0;
  for index_signed:=count1 downto count do
    loop_count:=loop_count+1;
  if loop_count <> LOOP_NUMS then
    failed := true;


  { lowerbound : LOC_REGISTER }
  { upper bound : constant     }
  count:=0;
  loop_count:=0;
  for index_signed:=LOOP_NUMS downto getupper0 do
    loop_count:=loop_count+1;
  if loop_count <> LOOP_NUMS then
    failed := true;
  { upper bound : LOC_REGISTER }
  loop_count:=0;
  for index_signed:=getupper downto getupper0 do
    loop_count:=loop_count+1;
  if loop_count <> LOOP_NUMS then
    failed := true;
  { upper bound : LOC_REFERENCE }
  loop_count:=0;
  for index_signed:=count1 downto getupper0 do
    loop_count:=loop_count+1;
  if loop_count <> LOOP_NUMS then
    failed := true;
  if failed then
    fail
  else
    WriteLn('Passed!');


  { UNSIGNED INDEX }
  Write('Unsigned index for loop testing (backward)...');
  loop_count:=0;
  failed := false;
  count := LOOP_NUMS;
  count1 := LOOP_NUMS;
  { lowerbound : constant        }
  { upper bound :: LOC_REFERENCE }
  for index_unsigned:=count downto 1 do
    loop_count:=loop_count+1;
  if loop_count <> LOOP_NUMS then
    failed := true;
  { upper bound : LOC_REGISTER  }
  loop_count:=0;
  for index_unsigned:=getupper downto 1 do
     loop_count:=loop_count+1;
  if loop_count <> LOOP_NUMS then
    failed := true;
  { upper bound : LOC_CONSTANT }
  loop_count:=0;
  for index_unsigned:=LOOP_NUMS downto 1 do
     loop_count:=loop_count+1;
  if loop_count <> LOOP_NUMS then
    failed := true;

  { lowerbound : LOC_REFERENCE }
  { upper bound : constant     }
  count:=1;
  loop_count:=0;
  for index_unsigned:=LOOP_NUMS downto count do
    loop_count:=loop_count+1;
  if loop_count <> LOOP_NUMS then
    failed := true;
  { upper bound : LOC_REGISTER }
  loop_count:=0;
  for index_unsigned:=getupper downto count do
    loop_count:=loop_count+1;
  if loop_count <> LOOP_NUMS then
    failed := true;
  { upper bound : LOC_REFERENCE }
  loop_count:=0;
  for index_unsigned:=count1 downto count do
    loop_count:=loop_count+1;
  if loop_count <> LOOP_NUMS then
    failed := true;


  { lowerbound : LOC_REGISTER }
  { upper bound : constant     }
  count:=0;
  loop_count:=0;
  for index_unsigned:=LOOP_NUMS downto getupper0 do
    loop_count:=loop_count+1;
  if loop_count <> LOOP_NUMS then
    failed := true;
  { upper bound : LOC_REGISTER }
  loop_count:=0;
  for index_unsigned:=getupper downto getupper0 do
    loop_count:=loop_count+1;
  if loop_count <> LOOP_NUMS then
    failed := true;
  { upper bound : LOC_REFERENCE }
  loop_count:=0;
  for index_unsigned:=count1 downto getupper0 do
    loop_count:=loop_count+1;
  if loop_count <> LOOP_NUMS then
    failed := true;
  if failed then
    fail
  else
    WriteLn('Passed!');

end.

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