fpc/tests/test/cg/tm128.pp
florian f61b074912 * (re)store alignment when doing a $push/$pop
git-svn-id: trunk@38020 -
2018-01-22 21:06:07 +00:00

36 lines
592 B
ObjectPascal

{$ASSERTIONS ON}
{$packrecords c}
{$push}
{$codealign recordmin=16}
type
tm128 = record
case byte of
1 : (m128_f32 : array[0..3] of single;)
end;
{$pop}
type
tm128_unaligned = record
case byte of
1 : (m128_f32 : array[0..3] of single;)
end;
var
tr1 : record
b : byte;
m128 : tm128;
end;
tr1_unaligned : record
b : byte;
m128_unaligned : tm128_unaligned;
end;
d : double;
begin
assert((sizeof(tm128))=16);
assert((ptruint(@tr1.m128) mod 16)=0);
assert((ptruint(@tr1_unaligned.m128_unaligned)-ptruint(@tr1_unaligned.b))=4);
end.