mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-08 01:08:07 +02:00

high(int64+1)..high(qword) if written in decimal notation) + test * fixed range checking of qword constants parsed by the compiler (they always gave a range error if > high(int64), because the compiler internally stores them as int64) * turn off range checking flag of rdconstnodes created by the parser from _INTCONST, because those are already range checked by the way they are parsed using val() git-svn-id: trunk@6814 -
26 lines
459 B
ObjectPascal
26 lines
459 B
ObjectPascal
{$r+}
|
|
|
|
const
|
|
q: qword = 18446744073709551615;
|
|
|
|
var
|
|
i: int64;
|
|
code: longint;
|
|
begin
|
|
val('18446744073709551615',i,code);
|
|
if (code = 0) then
|
|
halt(1);
|
|
val('-9223372036854775808',i,code);
|
|
if (code <> 0) or
|
|
(i <> low(int64)) then
|
|
halt(2);
|
|
val('9223372036854775807',i,code);
|
|
if (code <> 0) or
|
|
(i <> high(int64)) then
|
|
halt(3);
|
|
val('$8000000000000000',i,code);
|
|
if (code <> 0) or
|
|
(i <> low(int64)) then
|
|
halt(4);
|
|
end.
|