summaryrefslogtreecommitdiff
path: root/tests/test/terecs16.pp
blob: 99b3f86dba4479a4bc79bd9a4eec82812c9829ae (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
program terecs16;

{$mode delphi}
type
  TRec = record
    l: longint;
    constructor Create(a: longint);
  end;


var
  r: TRec;

  constructor TRec.Create(a: longint);
  begin
    l := a;
    r.l := 4;
    if l <> a then
      halt(1);
    l := 5;
    if r.l <> 4 then
      halt(2);
    r.l := 6;
  end;

begin
  r := TRec.Create(10);
  if r.l <> 5 then
    halt(3);
end.