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

whose size is not a power of two + some more packed array/record tests git-svn-id: trunk@7610 -
45 lines
579 B
ObjectPascal
45 lines
579 B
ObjectPascal
type
|
|
pbyte = ^byte;
|
|
|
|
tr = bitpacked record
|
|
a,b,c: byte;
|
|
d,e:0..15;
|
|
f: byte;
|
|
g: 0..$ffffff; { 3 bytes }
|
|
h: byte;
|
|
end;
|
|
|
|
procedure p(b: pbyte);
|
|
begin
|
|
b^ := $12
|
|
end;
|
|
|
|
var
|
|
r: tr;
|
|
begin
|
|
fillchar(r,sizeof(r),0);
|
|
p(@r.a);
|
|
if (r.a<>$12) then
|
|
halt(1);
|
|
|
|
fillchar(r,sizeof(r),0);
|
|
p(@r.b);
|
|
if (r.b<>$12) then
|
|
halt(1);
|
|
|
|
fillchar(r,sizeof(r),0);
|
|
p(@r.c);
|
|
if (r.c<>$12) then
|
|
halt(1);
|
|
|
|
fillchar(r,sizeof(r),0);
|
|
p(@r.f);
|
|
if (r.f<>$12) then
|
|
halt(1);
|
|
|
|
fillchar(r,sizeof(r),0);
|
|
p(@r.h);
|
|
if (r.h<>$12) then
|
|
halt(1);
|
|
end.
|