fpc/tests/webtbs/tw21177.pp
Jonas Maebe 1f83203117 * make self-pointer passed by reference not regable. Was not necessary
when we only had objects because they are never put in registers,
    but (advanced) records can be (mantis #21177)

git-svn-id: trunk@20192 -
2012-01-29 11:30:12 +00:00

30 lines
351 B
ObjectPascal

{$modeswitch ADVANCEDRECORDS}
{$OPTIMIZATION REGVAR}
program record_bug;
type
TColor = object
R : Byte;
function toDWord : DWord;
end;
function TColor.toDWord : DWord;
begin
r:=4;
toDWord:=5;
end;
procedure Fill(Color: TColor);
begin
Color.toDWord;
if color.r<>4 then
halt(1);
end;
var
c: TColor;
begin
c.r:=1;
Fill(c);
end.