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

e.g. passing a 3-byte record in a bitpacked array as var-parameter (mantis #17862) git-svn-id: trunk@16317 -
27 lines
318 B
ObjectPascal
27 lines
318 B
ObjectPascal
{$mode objfpc}
|
|
type
|
|
TField = record
|
|
a,b,c: byte;
|
|
end;
|
|
tarray = bitpacked array[0..3] of tfield;
|
|
|
|
procedure test(var a: tfield);
|
|
begin
|
|
if a.a<>3 then
|
|
halt(1);
|
|
if a.b<>4 then
|
|
halt(2);
|
|
if a.c<>5 then
|
|
halt(3);
|
|
end;
|
|
|
|
var
|
|
a: tarray;
|
|
begin
|
|
a[1].a:=3;
|
|
a[1].b:=4;
|
|
a[1].c:=5;
|
|
test(a[1]);
|
|
end.
|
|
|