fpc/tests/webtbs/tw12137.pp
Jonas Maebe 7d459cf12a * the compiler now explicitly keeps track of the minimally guaranteed
alignment for each memory reference (mantis #12137, and
    test/packages/fcl-registry/tregistry1.pp on sparc). This also
    enables better code generation for packed records in many cases.
  o several changes were made to the compiler to minimise the chances
    of accidentally forgetting to set the alignment of memory references
    in the future:
    - reference_reset*() now has an extra alignment parameter
    - location_reset() can now only be used for non LOC_(C)REFERENCE,
      use location_reset_ref() for those (split the tloc enum so the
      compiler can catch errors using range checking)

git-svn-id: trunk@12719 -
2009-02-08 13:00:24 +00:00

26 lines
576 B
ObjectPascal

{$t-}
type
TElementValidator = object
FElementDef: pointer;
FCurCP: pointer;
FFailed: Boolean;
end;
var
FValidator: array of TElementValidator;
i: longint;
begin
i:=1;
setlength(fvalidator,5);
writeln(ptruint(pointer(@fvalidator[1])-pointer(@fvalidator[0])));
{ aligned }
fvalidator[0].felementdef:=@FValidator;
fvalidator[0].fcurcp:=@FValidator;
{ unaligned }
fvalidator[1].felementdef:=@FValidator;
fvalidator[1].fcurcp:=@FValidator;
{ unaligned }
fvalidator[i].felementdef:=@FValidator;
fvalidator[i].fcurcp:=@FValidator;
end.