blob: 3fa52fc6844d1e49b75d04c1d26d6d396aaf6276 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
|
{$ifdef fpc}
{$mode fpc}
{$endif fpc}
function times2(x : longint) : longint;
begin
times2:=2*x;
end;
var
x:function(x:longint):longint;
y:pointer absolute x;
z,w,v:pointer;
begin
z:=@x;
w:=addr(x);
v:=@y;
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;
x:=@times2;
if (y<>pointer(@times2)) then
begin
writeln('Absolute Error');
halt(1);
end;
end.
|