mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-14 22:39:25 +02:00
33 lines
376 B
ObjectPascal
33 lines
376 B
ObjectPascal
{ %target=darwin,iphonesim}
|
|
{ %skipcpu=powerpc,powerpc64 }
|
|
|
|
{$modeswitch cblocks}
|
|
|
|
type
|
|
tblock = reference to procedure; cdecl;
|
|
|
|
procedure test(b: tblock);
|
|
begin
|
|
b;
|
|
end;
|
|
|
|
procedure proc;
|
|
begin
|
|
writeln('called as block');
|
|
end;
|
|
|
|
const
|
|
bconst: tblock = @proc;
|
|
|
|
var
|
|
b: tblock;
|
|
begin
|
|
b:=@proc;
|
|
b;
|
|
test(@proc);
|
|
test(b);
|
|
bconst;
|
|
test(bconst);
|
|
end.
|
|
|