mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-12-04 19:08:21 +01:00
reference -- except for method procvars, for tmethod record compatibility) * adapted tw11563 for corrected calling convention git-svn-id: trunk@12475 -
46 lines
862 B
ObjectPascal
46 lines
862 B
ObjectPascal
{ %target=linux}
|
|
{ %result=216 }
|
|
|
|
program ExecStack;
|
|
procedure DoIt;
|
|
type
|
|
proc = procedure;
|
|
var
|
|
{$if defined(cpupowerpc) or defined(cpupowerpc64)}
|
|
ret: longint;
|
|
{$endif}
|
|
{$if defined(cpui386) or defined(cpux86_64)}
|
|
ret: Byte;
|
|
{$endif}
|
|
{$ifdef cpuarm}
|
|
'add arm code to test stack execution'
|
|
{$endif}
|
|
DoNothing: proc;
|
|
|
|
begin
|
|
{$if defined(cpupowerpc) or defined(cpupowerpc64)}
|
|
ret := ($4e shl 24) or ($80 shl 16) or ($00 shl 8) or $20;
|
|
{$if defined(cpupowerpc64)}
|
|
{ can't use proc(@ret) because linux/ppc64 always expects some kind of
|
|
trampoline
|
|
}
|
|
asm
|
|
la r0, ret
|
|
mtctr r0
|
|
bctrl
|
|
end;
|
|
{$else}
|
|
DoNothing := proc(@ret);
|
|
DoNothing;
|
|
{$endif}
|
|
{$endif}
|
|
{$if defined(cpui386) or defined(cpux86_64)}
|
|
ret := $C3;
|
|
DoNothing := proc(@ret);
|
|
DoNothing;
|
|
{$endif}
|
|
end;
|
|
begin
|
|
DoIt;
|
|
end.
|