mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-07 11:08:02 +02:00

CodeWarrior compatibility in a more prominent way than failure to compile webtbs/tw17379a.pp (-> added %knowncompileerror) git-svn-id: trunk@15976 -
37 lines
510 B
ObjectPascal
37 lines
510 B
ObjectPascal
{%KNOWNCOMPILEERROR=CodeWarrior Pascal is sometimes similar to and sometimes different from TP/Delphi regarding calling procvars }
|
|
{$mode macpas}
|
|
|
|
program tmacfunret;
|
|
|
|
var
|
|
called:boolean;
|
|
|
|
function B(function x: integer): integer;
|
|
|
|
begin
|
|
b:=x;
|
|
end;
|
|
|
|
function A: Integer;
|
|
|
|
begin
|
|
if not called then
|
|
begin
|
|
called:=true;
|
|
A:=B(A);
|
|
end
|
|
else
|
|
A:=42;
|
|
end;
|
|
|
|
var
|
|
i: Integer;
|
|
|
|
begin
|
|
called:=false;
|
|
i:= A;
|
|
Writeln(i);
|
|
if i <> 42 then
|
|
halt(1);
|
|
end.
|