fpc/tests/tbs/tb0622.pp
Jonas Maebe 051317e82e * load the function result from the parentfpstruct to its original location
in exit nodes, because the wrapping code added in
    tnodeutils.wrap_proc_body() gets inserted before the exit label to which
    the exit node jumps

git-svn-id: trunk@34305 -
2016-08-13 14:47:50 +00:00

33 lines
383 B
ObjectPascal

{$mode objfpc}
function test: longint;
var
l: longint;
procedure nest;
begin
if result<>111 then
halt(1);
if l<>222 then
halt(2);
l:=1231;
result:=555;
end;
begin
result:=111;
l:=222;
nest;
if l<>1231 then
halt(3);
if result=555 then
exit;
result:=666;
end;
begin
if test<>555 then
halt(4);
end.