@@ -1,7 +1,13 @@
-{$ifdef FPC}
-{$mode Delphi}
-{$endif}
-{$APPTYPE CONSOLE}
+{$ifdef fpc}
+{$mode tp}
+{$endif fpc}
+
+function times2(x : longint) : longint;
+begin
+ times2:=2*x;
+end;
var
x:function(x:longint):longint;
y:pointer absolute x;
@@ -21,4 +27,11 @@ begin
writeln('Absolute Error');
halt(1);
end;
+ x:=times2;
+ if (y<>@times2) then
+ begin
+ writeln('Absolute Error');
+ halt(1);
+ end;
end.
@@ -0,0 +1,32 @@
+{$mode delphi}
+var
+ x:function(x:longint):longint;
+ y:pointer absolute x;
+ z,w,v:pointer;
+ z:=@x;
+ w:=addr(x);
+ v:=@times2;
+ writeln(longint(y),' ',longint(z),' ',longint(w),' ',longint(v));
+ if (z<>w) or (z<>v) or (y<>z) then
+ writeln('Addr Error');
+end.
@@ -0,0 +1,37 @@
+{$mode fpc}
+ v:=@y;
+ if (z<>w) or (z<>v) then
+ if (y<>nil) then
+ x:=@times2;
+ if (y<>pointer(@times2)) then