fpc/tests/test/cg/tpara3.pp
yury ec943198fd * Properly fill treference.alignment when variable is loaded by tcgloadnode. It allows code generator to insert unaligned handling if needed.
* Improved generic a_load_ref_reg_unaligned if ref alignment is 2.
* Improved unaligned load/store of register for ARM.
* It fixes passing records by value on ARM.
+ New test.

git-svn-id: trunk@10681 -
2008-04-16 23:01:20 +00:00

42 lines
557 B
ObjectPascal

type
TRec = record
bbb: array[1..8] of byte;
w: word;
end;
TRec2 = packed record
a: array[1..9] of char;
end;
procedure dotest(p: TRec);
var
i: longint;
begin
for i:=1 to 8 do
write(p.bbb[i], ' ');
writeln;
if qword(p.bbb)<>$0102030405060708 then begin
writeln('Test FAILED.');
Halt(1);
end;
end;
procedure dotest2(p: TRec);
var
rr: TRec2;
pp: TRec;
begin
pp:=p;
dotest(pp);
end;
var
b: byte;
p: TRec;
i: longint;
begin
qword(p.bbb):=$0102030405060708;
dotest2(p);
writeln('Test OK.');
end.