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

t_id 73
t_version 1.1
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 10:27:00 65
m68k 1 2.0 2024/10/19 07:29:00 50 2024/10/19 07:29:00 50
sparc 2 4.0 2024/10/19 08:05:00 45 2024/10/19 10:30:00 43
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 12 24.0 2024/10/19 08:27:00 30 2024/10/19 13:36:00 24
powerpc64 8 16.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 10:35:00 142 2024/10/19 10:35:00 142
aarch64 5 10.0 2024/10/19 08:15:00 27 2024/10/19 09:57:00 26
sparc64 4 8.0 2024/10/19 08:33:00 120 2024/10/19 11:33:00 117
riscv64 1 2.0 2024/10/19 11:10:00 26 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 33 66.0 2024/10/19 07:29:00 50 2024/10/19 11:38:00 25
go32v2 2 4.0 2024/10/19 09:39:00 55 2024/10/19 10:27:00 65
solaris 7 14.0 2024/10/19 13:22:00 24 2024/10/19 13:36:00 24
aix 8 16.0 2024/10/19 08:40:00 51 2024/10/19 13:26:00 65
3.3.1 28 56.0 2024/10/19 08:05:00 45 2024/10/19 13:26:00 65
3.2.3 22 44.0 2024/10/19 07:29:00 50 2024/10/19 13:36:00 24

Source:

{ %VERSION=1.1 }

{$ifdef fpc}
  {$mode objfpc}
{$endif}

uses SysUtils;

{$ifndef fpc}
type
  qword=int64;
  dword=cardinal;
{$endif}

var
  error: boolean;

{$r+}
function testlongint_int64(i: int64; shouldfail: boolean): boolean;
var
  l: longint;
  failed: boolean;
begin
  failed := false;
  try
    l := i;
  except
    failed := true;
  end;
  result := failed = shouldfail;
  error := error or not result;
end;

function testlongint_qword(i: qword; shouldfail: boolean): boolean;
var
  l: longint;
  failed: boolean;
begin
  failed := false;
  try
    l := i;
  except
    failed := true;
  end;
  result := failed = shouldfail;
  error := error or not result;
end;

function testdword_int64(i: int64; shouldfail: boolean): boolean;
var
  l: dword;
  failed: boolean;
begin
  failed := false;
  try
    l := i;
  except
    failed := true;
  end;
  result := failed = shouldfail;
  error := error or not result;
end;

function testdword_qword(i: qword; shouldfail: boolean): boolean;
var
  l: dword;
  failed: boolean;
begin
  failed := false;
  try
    l := i;
  except
    failed := true;
  end;
  result := failed = shouldfail;
  error := error or not result;
end;

{$r-}

var
  i: int64;
  q: qword;
begin
  error := false;
{ *********************** int64 to longint ********************* }
  writeln('int64 to longint');
  i := $ffffffffffffffff;
  writeln(i);
  if not testlongint_int64(i,false) then
    writeln('test1 failed');
  i := i and $ffffffff00000000;
  writeln(i);
  if not testlongint_int64(i,true) then
    writeln('test2 failed');
  inc(i);
  writeln(i);
  if not testlongint_int64(i,true) then
    writeln('test3 failed');
  i := $ffffffff80000000;
  writeln(i);
  if not testlongint_int64(i,false) then
    writeln('test4 failed');
  i := $80000000;
  writeln(i);
  if not testlongint_int64(i,true) then
    writeln('test5 failed');
  dec(i);
  writeln(i);
  if not testlongint_int64(i,false) then
    writeln('test6 failed');
  i := $ffffffff;
  writeln(i);
  if not testlongint_int64(i,true) then
    writeln('test7 failed');
  i := 0;
  writeln(i);
  if not testlongint_int64(i,false) then
    writeln('test8 failed');

{ *********************** qword to longint ********************* }
  writeln;
  writeln('qword to longint');
  q := qword($ffffffffffffffff);
  writeln(q);
  if not testlongint_qword(q,true) then
    writeln('test1 failed');
  q := q and $ffffffff00000000;
  writeln(q);
  if not testlongint_qword(q,true) then
    writeln('test2 failed');
  inc(q);
  writeln(q);
  if not testlongint_qword(q,true) then
    writeln('test3 failed');
  q := $ffffffff80000000;
  writeln(q);
  if not testlongint_qword(q,true) then
    writeln('test4 failed');
  q := $80000000;
  writeln(q);
  if not testlongint_qword(q,true) then
    writeln('test5 failed');
  dec(q);
  writeln(q);
  if not testlongint_qword(q,false) then
    writeln('test6 failed');
  q := $ffffffff;
  writeln(q);
  if not testlongint_qword(q,true) then
    writeln('test7 failed');
  q := 0;
  writeln(q);
  if not testlongint_qword(q,false) then
    writeln('test8 failed');

{ *********************** int64 to dword ********************* }
  writeln;
  writeln('int64 to dword');
  i := $ffffffffffffffff;
  writeln(i);
  if not testdword_int64(i,true) then
    writeln('test1 failed');
  i := i and $ffffffff00000000;
  writeln(i);
  if not testdword_int64(i,true) then
    writeln('test2 failed');
  inc(i);
  writeln(i);
  if not testdword_int64(i,true) then
    writeln('test3 failed');
  i := $ffffffff80000000;
  writeln(i);
  if not testdword_int64(i,true) then
    writeln('test4 failed');
  i := $80000000;
  writeln(i);
  if not testdword_int64(i,false) then
    writeln('test5 failed');
  dec(i);
  writeln(i);
  if not testdword_int64(i,false) then
    writeln('test6 failed');
  i := $ffffffff;
  writeln(i);
  if not testdword_int64(i,false) then
    writeln('test7 failed');
  i := 0;
  writeln(i);
  if not testdword_int64(i,false) then
    writeln('test8 failed');

{ *********************** qword to dword ********************* }
  writeln;
  writeln('qword to dword');
  q := $ffffffffffffffff;
  writeln(q);
  if not testdword_qword(q,true) then
    writeln('test1 failed');
  q := q and $ffffffff00000000;
  writeln(q);
  if not testdword_qword(q,true) then
    writeln('test2 failed');
  inc(q);
  writeln(q);
  if not testdword_qword(q,true) then
    writeln('test3 failed');
  q := $ffffffff80000000;
  writeln(q);
  if not testdword_qword(q,true) then
    writeln('test4 failed');
  q := $80000000;
  writeln(q);
  if not testdword_qword(q,false) then
    writeln('test5 failed');
  dec(q);
  writeln(q);
  if not testdword_qword(q,false) then
    writeln('test6 failed');
  q := $ffffffff;
  writeln(q);
  if not testdword_qword(q,false) then
    writeln('test7 failed');
  q := 0;
  writeln(q);
  if not testdword_qword(q,false) then
    writeln('test8 failed');

  if error then
    begin
      writeln;
      writeln('still range check problems!');
      halt(1);
    end;
end.

Link to SVN view of test/trange1.pp source.