summaryrefslogtreecommitdiff
path: root/fpcsrc/tests/webtbs/tw10757.pp
blob: 056e675ce675cabda4f82bddb342b73d565d2940 (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
{$MODE Objfpc}

type
  Ta = class 
    T: array of Double;
  end;

var
  a: Ta;

function P:Ta;
begin
  Result := a;
end;

function M: Double;
begin
  Result := 300;
end;

var
  i: Integer;

begin
  a := Ta.Create;
  SetLength(P.T,2);
  P.T[0] := 70;
  P.T[1] := 80;
  i := 0;
  while (i < Length(P.T)) and (M > P.T[i]) do
    Inc(i);
  if (i<>2) then
    halt(1);
end.