fpc/tests/test/taddstr1.pp
florian 454fb81c5b + optimize <string>+'' and ''+<string>
git-svn-id: trunk@3522 -
2006-05-14 09:43:53 +00:00

18 lines
266 B
ObjectPascal

{ tests if '' is optimized properly in string concatenations }
var
s1 : string;
s2 : string;
begin
s1:='asdf';
if s1+''<>s1 then
halt(1);
s1:='asdf';
if ''+s1<>s1 then
halt(1);
if ''+s2+''+s1+''<>s2+s1 then
halt(1);
writeln('ok');
end.