fpc/tests/webtbs/tw17836.pp
Jonas Maebe d1264eeb3a * fixed optimized division of signed values by constant power of 2 if the
constant is > high(longint), because then it must be loaded into a register
    first since such values cannot be encoded directly in non-mov x86-64
    instructions (mantis #17836)

git-svn-id: trunk@16305 -
2010-11-05 15:32:07 +00:00

22 lines
403 B
ObjectPascal

var
w,w1: int64;
begin
w1:=-1;
w:=w1 div (int64(1) shl 33);
system.writeln(w);
if w<>0 then
halt(1);
w:=w1 div (int64(1) shl 32);
system.writeln(w);
if w<>0 then
halt(2);
w:=w1 div (int64(1) shl 31);
system.writeln(w);
if w<>0 then
halt(3);
w:=w1 div (int64(1) shl 5);
system.writeln(w);
if w<>0 then
halt(4);
end.