diff --git a/.gitattributes b/.gitattributes index 714117a368..732fb47915 100644 --- a/.gitattributes +++ b/.gitattributes @@ -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 diff --git a/compiler/nadd.pas b/compiler/nadd.pas index e2b639bb9c..f03835f757 100644 --- a/compiler/nadd.pas +++ b/compiler/nadd.pas @@ -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 diff --git a/tests/webtbs/tw34385a.pp b/tests/webtbs/tw34385a.pp new file mode 100644 index 0000000000..c8afd40d55 --- /dev/null +++ b/tests/webtbs/tw34385a.pp @@ -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.