summaryrefslogtreecommitdiff
path: root/fpcsrc/tests/test/taddstr1.pp
blob: bb47b67608cbaa35800507d5471defdb5469f4ba (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
{ 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.