mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-21 22:09:33 +02:00
* problem with temp ansistrings
This commit is contained in:
parent
ed3945ca04
commit
8b58545947
23
tests/tbs/tb0480.pp
Normal file
23
tests/tbs/tb0480.pp
Normal 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.
|
||||
|
Loading…
Reference in New Issue
Block a user