FreePascal compatibility - how is this kind of code compiled in Delphi 10.3 Rio or 10.4 Sydney?

There is an interesting discussion going on in the FreePascal forum regarding how untyped unsigned literals are not used correctly with typed variables and expressions without needing explicit type-casts:

Implicit converison, literals and QWORD variable warning

(apparently the original thread has been locked, so I posted a reply in a new thread linking to this post here)

Some posts are suggesting this is handled differently between Delphi and FreePascal (regardless of whether Delphi mode is used or not) and are asking for confirmation about the behavior in the latest Delphi.  I don't have Rio or Sydney installed, so I can't answer this.

Here are some examples provided in that discussion that are causing issues in FreePascal.  How does Delphi handle them nowadays?  FYI, QWORD = UInt64.

var
  qw: QWORD;
begin
 
  // qw:= $FFFFFFFFFFFFFFFF;  // By compiler it is -1 and it shows range check warning, literals are treated as int64?
  qw:= QWORD($FFFFFFFFFFFFFFFF); // This will pass with exact cast, no warning
 
  writeln(inttostr(qw));

if qw < 0 then  // Warning: Comparison might be always false due to range of constant and expression
  Writeln('QWORD variable s less than 0!?!');   // Warning: unreachable code
 
if word($FFFFFFFFFFFFFFFF) < 0 then
  Writeln('Cast unsigned QWORD is less than 0!?!');    // Warning: unreachable code
 
if $FFFFFFFFFFFFFFFF < 0 then
  Writeln('Uncast literal $FFFFFFFFFFFFFFFF is treated as -1 !');  // It is always executed

// doesn't work
const
  c64: array [0..1] of QWord =
    (
    $0000000000000000,
    $FFFFFFFFFFFFFFFF
    );

// works
const
  c64: array [0..1] of QWord =
    (
    QWord($0000000000000000),
    QWord($FFFFFFFFFFFFFFFF)
    );

if $FFFFFFFFFFFFFFFF < 0 then // This should'n give warning  on Rio
  Writeln('Uncast literal $FFFFFFFFFFFFFFFF is treated as -1 !');  // It should never be executed on Rio