mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-06-04 22:58:36 +02:00
* implicitly call procvars in tp/delphi modes for divmodn, shlshrn
and notn (mantis 7200) git-svn-id: trunk@5724 -
This commit is contained in:
parent
92538bcb2a
commit
4ae9ac969a
1
.gitattributes
vendored
1
.gitattributes
vendored
@ -7785,6 +7785,7 @@ tests/webtbs/tw7143.pp -text
|
|||||||
tests/webtbs/tw7161.pp svneol=native#text/plain
|
tests/webtbs/tw7161.pp svneol=native#text/plain
|
||||||
tests/webtbs/tw7173.pp svneol=native#text/plain
|
tests/webtbs/tw7173.pp svneol=native#text/plain
|
||||||
tests/webtbs/tw7195.pp svneol=native#text/plain
|
tests/webtbs/tw7195.pp svneol=native#text/plain
|
||||||
|
tests/webtbs/tw7200.pp svneol=native#text/plain
|
||||||
tests/webtbs/tw7227.pp svneol=native#text/plain
|
tests/webtbs/tw7227.pp svneol=native#text/plain
|
||||||
tests/webtbs/tw7276.pp svneol=native#text/plain
|
tests/webtbs/tw7276.pp svneol=native#text/plain
|
||||||
tests/webtbs/tw7281.pp svneol=native#text/plain
|
tests/webtbs/tw7281.pp svneol=native#text/plain
|
||||||
|
@ -94,7 +94,8 @@ implementation
|
|||||||
defutil,
|
defutil,
|
||||||
htypechk,pass_1,
|
htypechk,pass_1,
|
||||||
cgbase,
|
cgbase,
|
||||||
ncon,ncnv,ncal,nadd;
|
ncon,ncnv,ncal,nadd,
|
||||||
|
nutils;
|
||||||
|
|
||||||
{****************************************************************************
|
{****************************************************************************
|
||||||
TMODDIVNODE
|
TMODDIVNODE
|
||||||
@ -164,6 +165,10 @@ implementation
|
|||||||
if codegenerror then
|
if codegenerror then
|
||||||
exit;
|
exit;
|
||||||
|
|
||||||
|
{ tp procvar support }
|
||||||
|
maybe_call_procvar(left,true);
|
||||||
|
maybe_call_procvar(right,true);
|
||||||
|
|
||||||
result:=simplify;
|
result:=simplify;
|
||||||
if assigned(result) then
|
if assigned(result) then
|
||||||
exit;
|
exit;
|
||||||
@ -495,6 +500,10 @@ implementation
|
|||||||
if codegenerror then
|
if codegenerror then
|
||||||
exit;
|
exit;
|
||||||
|
|
||||||
|
{ tp procvar support }
|
||||||
|
maybe_call_procvar(left,true);
|
||||||
|
maybe_call_procvar(right,true);
|
||||||
|
|
||||||
result:=simplify;
|
result:=simplify;
|
||||||
if assigned(result) then
|
if assigned(result) then
|
||||||
exit;
|
exit;
|
||||||
@ -853,6 +862,9 @@ implementation
|
|||||||
if codegenerror then
|
if codegenerror then
|
||||||
exit;
|
exit;
|
||||||
|
|
||||||
|
{ tp procvar support }
|
||||||
|
maybe_call_procvar(left,true);
|
||||||
|
|
||||||
resultdef:=left.resultdef;
|
resultdef:=left.resultdef;
|
||||||
|
|
||||||
result:=simplify;
|
result:=simplify;
|
||||||
|
32
tests/webtbs/tw7200.pp
Normal file
32
tests/webtbs/tw7200.pp
Normal file
@ -0,0 +1,32 @@
|
|||||||
|
{$mode delphi}
|
||||||
|
|
||||||
|
var i : integer;
|
||||||
|
|
||||||
|
function GetInt : integer;
|
||||||
|
begin
|
||||||
|
Result := 10;
|
||||||
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
var myfunc : function : integer;
|
||||||
|
|
||||||
|
|
||||||
|
begin
|
||||||
|
|
||||||
|
myfunc := GetInt;
|
||||||
|
|
||||||
|
//i := integer(myfunc) div 2; //works
|
||||||
|
//i := myfunc; i := i div 2; //works
|
||||||
|
i := myfunc div 2; //does not work
|
||||||
|
if (i <> 5) then
|
||||||
|
halt(1);
|
||||||
|
|
||||||
|
i := myfunc shr 2;
|
||||||
|
if i <> 2 then
|
||||||
|
halt(2);
|
||||||
|
|
||||||
|
i := not myfunc;
|
||||||
|
if i <> not(integer(10)) then
|
||||||
|
halt(3);
|
||||||
|
|
||||||
|
end.
|
Loading…
Reference in New Issue
Block a user