fpc/tests/webtbs/tw17379a.pp
Jonas Maebe 7f489635da * disabled maybe_call_procvar() again for macpas mode, because it breaks
CodeWarrior compatibility in a more prominent way than failure to
    compile webtbs/tw17379a.pp (-> added %knowncompileerror)

git-svn-id: trunk@15976 -
2010-09-13 20:14:27 +00:00

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.