mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-18 07:49:12 +02:00
* treat typecast(register) the same as typecast([register]) in assembler
expressions (for Delphi compatibility, mantis #9327) git-svn-id: trunk@13040 -
This commit is contained in:
parent
1bf74a426b
commit
ca132e203f
1
.gitattributes
vendored
1
.gitattributes
vendored
@ -9678,6 +9678,7 @@ tests/webtbs/tw9299.pp -text
|
|||||||
tests/webtbs/tw9306a.pp -text
|
tests/webtbs/tw9306a.pp -text
|
||||||
tests/webtbs/tw9306b.pp -text
|
tests/webtbs/tw9306b.pp -text
|
||||||
tests/webtbs/tw9309.pp -text
|
tests/webtbs/tw9309.pp -text
|
||||||
|
tests/webtbs/tw9327.pp svneol=native#text/plain
|
||||||
tests/webtbs/tw9347.pp svneol=native#text/plain
|
tests/webtbs/tw9347.pp svneol=native#text/plain
|
||||||
tests/webtbs/tw9347a.pp svneol=native#text/plain
|
tests/webtbs/tw9347a.pp svneol=native#text/plain
|
||||||
tests/webtbs/tw9347b.pp svneol=native#text/plain
|
tests/webtbs/tw9347b.pp svneol=native#text/plain
|
||||||
|
@ -1718,6 +1718,11 @@ Unit Rax86int;
|
|||||||
{ Support Type([Reference]) }
|
{ Support Type([Reference]) }
|
||||||
Consume(AS_LPAREN);
|
Consume(AS_LPAREN);
|
||||||
BuildOperand(oper,true);
|
BuildOperand(oper,true);
|
||||||
|
{ Delphi also supports Type(Register) and
|
||||||
|
interprets it the same as Type([Register]). }
|
||||||
|
if (oper.opr.typ = OPR_REGISTER) then
|
||||||
|
{ This also sets base to the register. }
|
||||||
|
oper.InitRef;
|
||||||
Consume(AS_RPAREN);
|
Consume(AS_RPAREN);
|
||||||
end;
|
end;
|
||||||
AS_LBRACKET :
|
AS_LBRACKET :
|
||||||
|
23
tests/webtbs/tw9327.pp
Normal file
23
tests/webtbs/tw9327.pp
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
{% opt=-Cg- }
|
||||||
|
{% cpu=i386 }
|
||||||
|
|
||||||
|
program fpcbug;
|
||||||
|
|
||||||
|
{$asmmode intel}
|
||||||
|
|
||||||
|
type
|
||||||
|
TBla = record
|
||||||
|
Bla: Cardinal;
|
||||||
|
end;
|
||||||
|
|
||||||
|
var
|
||||||
|
b: tbla;
|
||||||
|
begin
|
||||||
|
asm
|
||||||
|
lea edi, b
|
||||||
|
mov eax, $12345678
|
||||||
|
mov TBla(edi).&Bla, eax
|
||||||
|
end;
|
||||||
|
if b.bla<>$12345678 then
|
||||||
|
halt(1);
|
||||||
|
end.
|
Loading…
Reference in New Issue
Block a user