+ add a test for converting a 64-bit Boolean (either QWordBool or Boolean64) to a 32-bit signed integer (this problematic case was discovered after e65b822a on PowerPC

This commit is contained in:
Sven Barth 2021-12-05 15:11:24 +01:00
parent 2636966e2a
commit 69bfff046a

35
tests/tbs/tb0688.pp Normal file
View File

@ -0,0 +1,35 @@
program tb0688;
function Test(var aArg: QWordBool): LongInt;
begin
Test := LongInt(aArg);
end;
function Test(var aArg: Boolean64): LongInt;
begin
Test := LongInt(aArg);
end;
var
b64: Boolean64;
qb: QWordBool;
begin
b64 := True;
if Test(b64) <> 1 then
Halt(1);
b64 := False;
if Test(b64) <> 0 then
Halt(2);
qb := True;
if Test(qb) <> -1 then
Halt(3);
qb := False;
if Test(qb) <> 0 then
Halt(4);
qb := QWordBool($12341234);
if Test(qb) <> $12341234 then
Halt(5);
qb := QWordBool($100000000);
if Test(qb) <> 0 then
Halt(6);
end.