mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-08 15:49:04 +02:00
25 lines
397 B
ObjectPascal
25 lines
397 B
ObjectPascal
{ %CPU=i8086 }
|
|
|
|
program tanonfunc57;
|
|
|
|
{$mode objfpc}{$H+}
|
|
{$modeswitch anonymousfunctions}
|
|
|
|
type
|
|
TFarFunc = function: LongInt; far;
|
|
TNearFunc = function: LongInt; near;
|
|
|
|
var
|
|
f: TFarFunc;
|
|
n: TNearFunc;
|
|
begin
|
|
f := function: LongInt far begin Result := 42; end;
|
|
n := function: LongInt near begin Result := 21; end;
|
|
|
|
if f() <> 42 then
|
|
Halt(1);
|
|
if n() <> 21 then
|
|
Halt(2);
|
|
end.
|
|
|