mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-09-12 17:49:07 +02:00
* qword(longint) test
This commit is contained in:
parent
2b1fee21f1
commit
26c0a0a3f3
@ -9,8 +9,10 @@ const
|
||||
i1 : int64 = $ffffffff;
|
||||
u2 : qword = -1;
|
||||
i2 : int64 = -1;
|
||||
|
||||
var
|
||||
l : longint;
|
||||
begin
|
||||
l:=-1;
|
||||
Writeln(' qword($ffffffff) = ',u1);
|
||||
Writeln(' int64($ffffffff) = ',i1);
|
||||
Writeln(' qword(-1) = ',u2);
|
||||
@ -21,4 +23,17 @@ begin
|
||||
Writeln('generates a wrong int64 constant');
|
||||
RunError(1);
|
||||
end;
|
||||
|
||||
if u2<>qword(int64(l)) then
|
||||
begin
|
||||
Writeln('"const u2 : qword = -1;" code');
|
||||
Writeln('generates a wrong int64 constant');
|
||||
RunError(1);
|
||||
end;
|
||||
|
||||
if qword(l)<>u2 then
|
||||
begin
|
||||
writeln('qword(longint) sign extension generates wrong code');
|
||||
halt(1);
|
||||
end;
|
||||
end.
|
||||
|
Loading…
Reference in New Issue
Block a user