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

treated as a regvar from pass_1 to the code generator, because this can always occur with a function result from a called function (in case the ABI prescribes returning certain records in registers) (mantis #16163) git-svn-id: trunk@15101 -
37 lines
611 B
ObjectPascal
37 lines
611 B
ObjectPascal
{ %norun }
|
|
|
|
program test;
|
|
|
|
{$mode objfpc}
|
|
|
|
type
|
|
TFColor = record
|
|
b, g, r : Byte;
|
|
// m : Byte; // uncomment it to avoid InternalError 200301231
|
|
end;
|
|
|
|
TFColorA = record
|
|
c : TFColor;
|
|
a : Byte;
|
|
// adding some field here, or chaning a type to Word or Interger
|
|
// also fixed the problem.
|
|
end;
|
|
|
|
function FColorToFColorA(C : TFColor) : TFColorA;
|
|
begin
|
|
Result.c:=C;
|
|
Result.a:=255;
|
|
end;
|
|
|
|
var
|
|
t : TFColor;
|
|
a : TFColor;
|
|
begin
|
|
FillChar(a, sizeof(a), $55);
|
|
t:=FColorToFColorA(a).c; // IE 200301231 why?
|
|
if (t.b<>$55) or
|
|
(t.r<>$55) or
|
|
(t.g<>$55) then
|
|
halt(1);
|
|
end.
|