* 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:
Jonas Maebe 2009-04-25 15:37:38 +00:00
parent 1bf74a426b
commit ca132e203f
3 changed files with 29 additions and 0 deletions

1
.gitattributes vendored
View File

@ -9678,6 +9678,7 @@ tests/webtbs/tw9299.pp -text
tests/webtbs/tw9306a.pp -text
tests/webtbs/tw9306b.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/tw9347a.pp svneol=native#text/plain
tests/webtbs/tw9347b.pp svneol=native#text/plain

View File

@ -1718,6 +1718,11 @@ Unit Rax86int;
{ Support Type([Reference]) }
Consume(AS_LPAREN);
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);
end;
AS_LBRACKET :

23
tests/webtbs/tw9327.pp Normal file
View 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.