fpc/tests/webtbs/tw22133.pp
Jonas Maebe 9e0184884e * correctly change the signdness information of tordconstnodes that are
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 -
2012-05-26 13:31:23 +00:00

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.