summaryrefslogtreecommitdiff
path: root/fpcsrc/tests/test/opt/tspace.pp
blob: 713dcf72148427885f1839292029bb8146d6cf41 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
{ %opt=-O2 }

function space (b : byte): shortstring;
begin
  space[0] := chr(b);
  FillChar (Space[1],b,' ');
end;

var
  s: string;
  i: longint;
begin
  fillchar(s,sizeof(s),255);
  s:=space(255);
  if length(s)<>255 then
    halt(1);
  for i:=1 to 255 do
    if s[i]<>' ' then
      halt(2);
end.