mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-05 10:38:14 +02:00
28 lines
350 B
ObjectPascal
28 lines
350 B
ObjectPascal
{ %skiptarget=android }
|
|
{ %cpu=i386,x86_64 }
|
|
{ %opt=-Cg- }
|
|
{$mode objfpc}
|
|
{$asmmode intel}
|
|
|
|
|
|
function bar: integer;
|
|
begin
|
|
result:=$12345678;
|
|
end;
|
|
|
|
function foo: pointer; assembler; nostackframe;
|
|
asm
|
|
{$ifdef cpux86_64}
|
|
lea rax,[bar+rip]
|
|
{$else}
|
|
lea eax,[bar]
|
|
{$endif}
|
|
end;
|
|
|
|
|
|
begin
|
|
if (foo<>pointer(@bar)) then
|
|
halt(1);
|
|
end.
|
|
|