mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-10 16:06:22 +02:00
* transform -x-1 into not(x), resolves #40313
This commit is contained in:
parent
1f2203c304
commit
59c77a48b5
@ -932,6 +932,13 @@ implementation
|
||||
left:=nil;
|
||||
tmoddivnode(right).right:=nil;
|
||||
exit;
|
||||
end
|
||||
|
||||
{ transform -x-1 into not(x) }
|
||||
else if is_signed(ld) and is_constintnode(right) and (tordconstnode(right).value=1) and (left.nodetype=unaryminusn) then
|
||||
begin
|
||||
result:=cnotnode.create(tunaryminusnode(left).left.getcopy);
|
||||
exit;
|
||||
end;
|
||||
end;
|
||||
|
||||
|
9
tests/tbs/tb0711.pp
Normal file
9
tests/tbs/tb0711.pp
Normal file
@ -0,0 +1,9 @@
|
||||
var
|
||||
l : longint;
|
||||
|
||||
begin
|
||||
l:=1234;
|
||||
|
||||
if -l-1<>-1235 then
|
||||
halt(1);
|
||||
end.
|
Loading…
Reference in New Issue
Block a user