mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-09 02:28:14 +02:00

when we only had objects because they are never put in registers, but (advanced) records can be (mantis #21177) git-svn-id: trunk@20192 -
30 lines
351 B
ObjectPascal
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.
|