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

t_id 396
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/06/02 01:36:00 47 2024/06/02 06:26:00 40
i386 7 14.0 2024/06/02 01:36:00 47 2024/06/02 05:39:00 44
m68k 2 4.0 2024/06/02 03:55:00 53 2024/06/02 05:48:00 63
sparc 5 10.0 2024/06/02 03:07:00 41 2024/06/02 05:32:00 44
powerpc 1 2.0 2024/06/02 04:10:00 238 2024/06/02 04:10:00 238
arm 1 2.0 2024/06/02 05:51:00 67 2024/06/02 05:51:00 67
x86_64 20 40.0 2024/06/02 01:57:00 22 2024/06/02 06:26:00 40
powerpc64 4 8.0 2024/06/02 04:15:00 53 2024/06/02 04:32:00 57
mips 1 2.0 2024/06/02 04:00:00 47 2024/06/02 04:00:00 47
mipsel 1 2.0 2024/06/02 04:06:00 185 2024/06/02 04:06:00 185
aarch64 6 12.0 2024/06/02 01:46:00 39 2024/06/02 05:49:00 0
sparc64 1 2.0 2024/06/02 05:03:00 157 2024/06/02 05:03:00 157
riscv64 1 2.0 2024/06/02 04:39:00 31 2024/06/02 04:39:00 31
linux 39 78.0 2024/06/02 01:36:00 47 2024/06/02 05:51:00 67
go32v2 2 4.0 2024/06/02 04:24:00 56 2024/06/02 05:03:00 55
solaris 7 14.0 2024/06/02 03:07:00 41 2024/06/02 06:26:00 40
darwin 2 4.0 2024/06/02 05:42:00 24 2024/06/02 05:49:00 0
3.3.1 23 46.0 2024/06/02 01:46:00 39 2024/06/02 06:26:00 40
3.2.3 27 54.0 2024/06/02 01:36:00 47 2024/06/02 05:51:00 67

Source:

{ Old file: tbs0188.pp }
{ can't print function result of procedural var that returns a function. Not a bugs : wrong syntax !! See source (PM) }

{ this are no bugs, just wrong
  understanding of FPC syntax }

type testfunc = function:longint;

var f : testfunc;

var test: testfunc;

function test_temp: longint;
begin
  test_temp:=12;
end;

procedure sound(test: testfunc);
begin
  {writeln(test); this is wrong because
   test is the function itself and write does not know how to
   output a function !
   to call test you must use test() !! }
  writeln(test());
end; { proc. sound }

var i : longint;
begin
  i:=test_temp;
  f:=@test_temp;
  if f()<>i then
    begin
       Writeln('error calling f');
       Halt(1);
    end;

  { this works for FPC
   sound(test_temp);
  but the correct syntax would be }
  sound(@test_temp);
  { imagine if a function would return its own type !! }

  { for f var this is correct also ! }
  sound(f);
end.

Link to SVN view of tbs/tb0157.pp source.