mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-14 00:19:25 +02:00
* fixed test for 64 bit targets
This commit is contained in:
parent
910ff87b4f
commit
4e8795893e
@ -24,10 +24,10 @@ procedure RefCount(const s : string;expect:longint);
|
|||||||
type
|
type
|
||||||
PLongint = ^Longint;
|
PLongint = ^Longint;
|
||||||
var
|
var
|
||||||
P : PLongint;
|
P : psizeint;
|
||||||
rc : longint;
|
rc : longint;
|
||||||
begin
|
begin
|
||||||
P := PLongint(s);
|
P := psizeint(s);
|
||||||
rc:=0;
|
rc:=0;
|
||||||
if (p = nil)
|
if (p = nil)
|
||||||
then writeln('Nil string.')
|
then writeln('Nil string.')
|
||||||
@ -36,10 +36,10 @@ begin
|
|||||||
{$if defined(ver1_0) or defined(ver1_9_4)}
|
{$if defined(ver1_0) or defined(ver1_9_4)}
|
||||||
rc:=(p-1)^;
|
rc:=(p-1)^;
|
||||||
{$else}
|
{$else}
|
||||||
rc:=plongint(pchar(p)-8)^;
|
rc:=psizeint(pchar(p)-sizeof(sizeint)*2)^;
|
||||||
{$endif}
|
{$endif}
|
||||||
{$else}
|
{$else}
|
||||||
rc:=plongint(pchar(p)-8)^;
|
rc:=psizeint(pchar(p)-sizeof(sizeint)*2)^;
|
||||||
{$endif}
|
{$endif}
|
||||||
writeln('Ref count is ',rc,' expected ',expect);
|
writeln('Ref count is ',rc,' expected ',expect);
|
||||||
if rc<>expect then
|
if rc<>expect then
|
||||||
@ -69,4 +69,4 @@ begin
|
|||||||
ARecordWithStrings := FunctionResultIsRecord(ARecordWithStrings);
|
ARecordWithStrings := FunctionResultIsRecord(ARecordWithStrings);
|
||||||
twostring := onestring + twostring;
|
twostring := onestring + twostring;
|
||||||
RefCount(ARecordWithStrings.one,2);
|
RefCount(ARecordWithStrings.one,2);
|
||||||
end.
|
end.
|
Loading…
Reference in New Issue
Block a user