mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-10-20 04:51:39 +02:00

simplified via typeconvnode (corrects resultdef of "qword(1) shl 33", mantis #22133) * simplify shl/shr nodes after their resultdef has been set, so the resultdef used during simplify is set (fixes same expression as above when it is calculated by an inline function) git-svn-id: trunk@21394 -
33 lines
480 B
ObjectPascal
33 lines
480 B
ObjectPascal
program tw22133;
|
|
|
|
{$mode objfpc}{$H+}
|
|
|
|
type
|
|
uint64 = qword;
|
|
|
|
var
|
|
T64:UInt64;
|
|
|
|
//force checking constants in compile-time
|
|
{$RANGECHECKS ON}
|
|
|
|
{$inline on}
|
|
|
|
function testshift(a:uint64; b: byte): uint64; inline;
|
|
begin
|
|
result:=a shl b;
|
|
end;
|
|
|
|
begin
|
|
T64:=UInt64(1 shl 63);
|
|
if T64<>uint64(high(int64)+1) then
|
|
halt(1);
|
|
T64:=UInt64(1) shl 63;
|
|
if T64<>uint64(high(int64)+1) then
|
|
halt(2);
|
|
T64:=testshift(1,63);
|
|
if T64<>uint64(high(int64)+1) then
|
|
halt(3);
|
|
end.
|
|
|