summaryrefslogtreecommitdiff
path: root/fpcsrc/tests/test/tprop1.pp
blob: 6514902a9d866249c5c65e273e772c9537234987 (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
38
39
{$mode fpc}
var
  FErrno : longint;
function GetROVar:longint;
begin
  GetROVar:=3;
end;
function GetErrno:longint;
begin
  GetErrno:=FErrno;
end;
procedure SetErrno(e:longint);
begin
  FErrno:=e;
end;

property
  Errno:longint read GetErrno write SetErrno;
  ROVar:longint read GetROVar;

begin
  FErrno:=1;
  if Errno<>1 then
    begin
      writeln('Error 1');
      halt(1);
    end;
  Errno:=2;
  if Errno<>2 then
    begin
      writeln('Error 2');
      halt(1);
    end;
  if ROVar<>3 then
    begin
      writeln('Error 3');
      halt(1);
    end;
end.