* problem with temp ansistrings

This commit is contained in:
peter 2004-09-22 20:21:43 +00:00
parent ed3945ca04
commit 8b58545947

23
tests/tbs/tb0480.pp Normal file
View File

@ -0,0 +1,23 @@
{$ifdef fpc}{$mode delphi}{$endif}
procedure Test(const s1, s2: PAnsiChar);
begin
Writeln(s1);
Writeln(s2);
if ansistring(s1)<>ansistring(s2) then
begin
writeln('Error');
halt(1);
end;
end;
var
S: AnsiString;
P: PAnsiChar;
begin
S := 'Test';
P := PAnsiChar(S);
Test(PAnsiChar('String:'+S+';'), PAnsiChar('String:'+S+';'));
Test(PAnsiChar('String:'+P+';'), PAnsiChar('String:'+P+';'));
end.