summaryrefslogtreecommitdiff
path: root/fpcsrc/tests/test/opt/tdfa2.pp
blob: 67c1a60ef5e4afcd9c2cfabcbe97321c58a79f2e (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
40
41
42
43
44
45
46
47
48
49
50
{ %OPT=-Oodfa -Sew -vw}
program tdfa2;
{$mode objfpc}{$h+}

procedure test0;
const
  c: array[0..3] of integer = (0,1,2,3);
begin
  writeln(c[1]);
end;

procedure test1;
var
  i: integer;
begin
  for i:=0 to 10 do
    if i=5 then
    ;
end;

function test2(S1: PWideChar; Len: Integer): Integer;
var
  counter: Integer;
  c1: Word;
begin
  counter:=0;  
  repeat
    c1 := ord(s1[counter]);
    counter:=counter+1;
  until counter>=len;
  result := c1;
end;

function test3(S1: PWideChar; Len: Integer): Integer;
var
  counter: Integer;
  c1: Word;
begin
  counter:=0;  
  while counter<len do
  begin
    c1 := ord(s1[counter]);
    counter:=counter+1;
  end;
  result := c1;
end;


begin
end.