mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-13 06:29:32 +02:00
* procvar and absolute probs
* procvar and addr() probs
This commit is contained in:
parent
45eff4e71b
commit
107c954939
24
tests/tbs/tb0433.pp
Normal file
24
tests/tbs/tb0433.pp
Normal file
@ -0,0 +1,24 @@
|
||||
{$ifdef FPC}
|
||||
{$mode Delphi}
|
||||
{$endif}
|
||||
{$APPTYPE CONSOLE}
|
||||
var
|
||||
x:function(x:longint):longint;
|
||||
y:pointer absolute x;
|
||||
z,w,v:pointer;
|
||||
begin
|
||||
z:=@@x;
|
||||
w:=addr(@x);
|
||||
v:=@(addr(x));
|
||||
writeln(longint(y),' ',longint(z),' ',longint(w),' ',longint(v));
|
||||
if (z<>w) or (z<>v) then
|
||||
begin
|
||||
writeln('Addr Error');
|
||||
halt(1);
|
||||
end;
|
||||
if (y<>nil) then
|
||||
begin
|
||||
writeln('Absolute Error');
|
||||
halt(1);
|
||||
end;
|
||||
end.
|
7
tests/tbs/tb0434.pp
Normal file
7
tests/tbs/tb0434.pp
Normal file
@ -0,0 +1,7 @@
|
||||
var
|
||||
x:function:longint;
|
||||
y:pointer absolute x;
|
||||
begin
|
||||
if y<>nil then
|
||||
halt(1);
|
||||
end.
|
10
tests/tbs/tb0435.pp
Normal file
10
tests/tbs/tb0435.pp
Normal file
@ -0,0 +1,10 @@
|
||||
|
||||
{$ifdef fpc}{$mode Delphi}{$endif}
|
||||
|
||||
var
|
||||
x:function(x:longint):longint;
|
||||
y:pointer absolute x;
|
||||
begin
|
||||
if y<>nil then
|
||||
halt(1);
|
||||
end.
|
Loading…
Reference in New Issue
Block a user