mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-11-02 19:43:15 +01:00
+ 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:
parent
2636966e2a
commit
69bfff046a
35
tests/tbs/tb0688.pp
Normal file
35
tests/tbs/tb0688.pp
Normal 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.
|
||||
Loading…
Reference in New Issue
Block a user