mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-08 23:29:29 +02:00
24 lines
483 B
ObjectPascal
24 lines
483 B
ObjectPascal
program comparechar0bug;
|
|
|
|
var str1 : pchar = 'test';
|
|
str2 : pchar = 'test';
|
|
str3 : pchar = 'testa';
|
|
str4 : pchar = 'asdf';
|
|
res : longint;
|
|
begin
|
|
res:=CompareChar0(str1[0],str2[0],maxint);
|
|
if res<>0 then
|
|
halt(1);
|
|
res:=CompareChar0(str1[0],str3[0],maxint);
|
|
if res>=0 then
|
|
halt(1);
|
|
res:=CompareChar0(str4[0],str1[0],maxint);
|
|
if res>=0 then
|
|
halt(1);
|
|
res:=CompareChar0(str1[0],str4[0],maxint);
|
|
if res<=0 then
|
|
halt(1);
|
|
|
|
writeln('ok');
|
|
end.
|