summaryrefslogtreecommitdiff
path: root/fpcsrc/tests/tbs/tb0282.pp
blob: fd91b7f07b2f63b75c3082eb804cbbdb85177c22 (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
{ Old file: tbs0334.pp }
{  }

{$ifdef fpc}{$mode objfpc}{$endif}

type
  tvarrec=record
    vpointer : pointer;
  end;
var
  r : tvarrec;
  b : boolean;
function Next: TVarRec;
begin
  next:=r;
end;

begin
  r.vpointer:=@b;
  { The result of next is loaded and a value is assigned }
  with Next do
   boolean(VPointer^) := true;
  if not b then
   writeln('Error with assigning to function result');
end.