fpc/tests/test/tmacfunret.pp
Jonas Maebe b9ed22b705 * CodeWarrior apparently supports a combination of FPC-like using the
function result as a variable, and Delphi/TP-like "using the function name
    inside the function means a recursive call". In order to prevent
    confusion, we no longer support the former behaviour since r21817
    because the conditions under which one or the other holds are not well
    defined and it's easier to fix a compiler error then to discover why
    a recursive function call doesn't do anything (mantis #22344)

git-svn-id: trunk@24182 -
2013-04-07 15:51:02 +00:00

27 lines
243 B
ObjectPascal

{ %fail }
program tmacfunret;
{$MODE MACPAS}
procedure B(var x: Integer);
begin
x:= 42;
end;
function A: Integer;
begin
B(A);
end;
var
i: Integer;
begin
i:= A;
Writeln(i);
if i <> 42 then
halt(1);
end.