fpc/tests/tbs/tb0508.pp
Jonas Maebe 5acc8b44a8 * activated internal get_frame for x86
* turn off stackframe optimizations on x86 if get_frame is called
    in the current routine, or if the address of a nested function
    is taken in the current routine
  + test for the above
  * this fixes the IDE when compiled with stackframe optimizations
    on x86

git-svn-id: trunk@5146 -
2006-11-01 12:48:53 +00:00

40 lines
464 B
ObjectPascal

type
PointerLocal = procedure(_EBP: Pointer);
procedure proccall(p: pointer);
begin
PointerLocal(p)(get_caller_frame(get_frame));
end;
procedure t1;
var
l : longint;
procedure t2;
procedure t3;
procedure t4;
begin
l := 5;
end;
begin { t3 }
proccall(@t4);
end;
begin { t2 }
t3;
end;
begin { t1 }
l := 0;
t2;
if (l <> 5) then
halt(1);
end;
begin
t1;
end.