fpc/tests/tbs/tb0508.pp
Jonas Maebe 15532e5277 * disabled low-level hack test for LLVM
git-svn-id: trunk@42102 -
2019-05-19 19:20:38 +00:00

54 lines
765 B
ObjectPascal

{ inlining is not compatible with get_caller_frame/get_frame }
{$inline off}
{$ifndef cpullvm}
type
PointerLocal = procedure(_EBP: Pointer);
procedure proccall(p: codepointer);
begin
{$ifndef FPC_LOCALS_ARE_STACK_REG_RELATIVE}
PointerLocal(p)(get_caller_frame(get_frame,get_pc_addr));
{$else}
PointerLocal(p)(get_frame);
{$endif}
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.
{$else ndef cpullvm}
begin
{ this kind of hacks can never work on llvm }
end.
{$endif cpullvm}