mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-08 02:07:53 +02:00
* fixed range test optimization for signed types and enabled it for them
git-svn-id: trunk@42332 -
This commit is contained in:
parent
b270b0f7f0
commit
40082100e1
1
.gitattributes
vendored
1
.gitattributes
vendored
@ -16615,6 +16615,7 @@ tests/webtbs/tw34332.pp svneol=native#text/pascal
|
||||
tests/webtbs/tw3435.pp svneol=native#text/plain
|
||||
tests/webtbs/tw34380.pp svneol=native#text/plain
|
||||
tests/webtbs/tw34385.pp svneol=native#text/plain
|
||||
tests/webtbs/tw34385a.pp svneol=native#text/plain
|
||||
tests/webtbs/tw3441.pp svneol=native#text/plain
|
||||
tests/webtbs/tw3443.pp svneol=native#text/plain
|
||||
tests/webtbs/tw34438.pp svneol=native#text/pascal
|
||||
|
@ -389,7 +389,7 @@ implementation
|
||||
var
|
||||
swapl, swapr: Boolean;
|
||||
valuer: tnode;
|
||||
t: QWord;
|
||||
t: Tconstexprint;
|
||||
begin
|
||||
result:=false;
|
||||
swapl:=false;
|
||||
@ -398,29 +398,26 @@ implementation
|
||||
if nodel.left.nodetype=ordconstn then
|
||||
begin
|
||||
swapl:=true;
|
||||
cl:=tordconstnode(nodel.left).value.uvalue;
|
||||
cl:=tordconstnode(nodel.left).value;
|
||||
value:=nodel.right;
|
||||
end
|
||||
else if nodel.right.nodetype=ordconstn then
|
||||
begin
|
||||
cl:=tordconstnode(nodel.right).value.uvalue;
|
||||
cl:=tordconstnode(nodel.right).value;
|
||||
value:=nodel.left;
|
||||
end
|
||||
else
|
||||
exit;
|
||||
|
||||
if is_signed(value.resultdef) then
|
||||
exit;
|
||||
|
||||
if noder.left.nodetype=ordconstn then
|
||||
begin
|
||||
swapl:=true;
|
||||
cr:=tordconstnode(noder.left).value.uvalue;
|
||||
cr:=tordconstnode(noder.left).value;
|
||||
valuer:=noder.right;
|
||||
end
|
||||
else if noder.right.nodetype=ordconstn then
|
||||
begin
|
||||
cr:=tordconstnode(noder.right).value.uvalue;
|
||||
cr:=tordconstnode(noder.right).value;
|
||||
valuer:=noder.left;
|
||||
end
|
||||
else
|
||||
|
33
tests/webtbs/tw34385a.pp
Normal file
33
tests/webtbs/tw34385a.pp
Normal file
@ -0,0 +1,33 @@
|
||||
{$r+}
|
||||
|
||||
program rangeTest;
|
||||
const
|
||||
w : longint = 123;
|
||||
n : longint = 48;
|
||||
m : longint = -5;
|
||||
k : longint = low(longint);
|
||||
begin
|
||||
if (w<=1) and (w>=10) then
|
||||
halt(1);
|
||||
|
||||
if (w>=1) and (w<=1000) then
|
||||
else
|
||||
halt(2);
|
||||
|
||||
if (n>44)and(n<48) then
|
||||
halt(3);
|
||||
|
||||
if (m>=-4) and (m<=$7ffffffe) then
|
||||
halt(4);
|
||||
|
||||
if (m>=-5) and (m<=$7ffffffe) then
|
||||
else
|
||||
halt(5);
|
||||
|
||||
if (m>=-$7fffffff) and (m<=$7ffffffe) then
|
||||
else
|
||||
halt(6);
|
||||
|
||||
if (k>=-$7fffffff) and (k<=$7ffffffe) then
|
||||
halt(7);
|
||||
end.
|
Loading…
Reference in New Issue
Block a user