summaryrefslogtreecommitdiff
path: root/tests/test/opt/treg3.pp
blob: 8b5a73c630547865783e8952f3d4b87816173b46 (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
{ %OPT=-Ooregvar }
program rangecse;

{$r+}

type
  pa = ^ta;
  ta = array[0..100] of longint;

procedure t;
var
  i, j: longint;
  p: pa;
begin
  new(p);
  fillchar(p^,101*sizeof(longint),0);
  p^[100] := 5;
  j := 5;
  for i:=1 to 101 do
   if j=p^[i-1] then
    begin
      writeln('found!');
      dispose(p);
      exit;
    end;
  writeln('failed..');
  dispose(p);
  halt(1);
end;

begin
  t;
end.