* procvar and absolute probs

* procvar and addr() probs
This commit is contained in:
peter 2002-12-17 19:13:49 +00:00
parent 45eff4e71b
commit 107c954939
3 changed files with 41 additions and 0 deletions

24
tests/tbs/tb0433.pp Normal file
View 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
View 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
View 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.