fpc/tests/test/opt/tspace.pp
Jonas Maebe c03f19fa50 * in case of "movzbl %dl,%edx" etc, %edx depends on its previous value.
regloadedwithnewvalue() gave the wrong answer for this in case
    candependonprevvalue was false (caused a wrong optimization in the
    space() function of the rtl)

git-svn-id: trunk@8808 -
2007-10-14 20:22:23 +00:00

21 lines
301 B
ObjectPascal

{ %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.