tw28927.pp 651 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. type
  2. TRecord1 = record
  3. end align 16;
  4. TRecord2 = record
  5. end align 8;
  6. TRecord3 = record
  7. end align 4;
  8. TRecord1Outer = record
  9. b : Byte;
  10. Record1 : TRecord1;
  11. end;
  12. TRecord2Outer = record
  13. b : Byte;
  14. Record2 : TRecord2;
  15. end;
  16. TRecord3Outer = record
  17. b : Byte;
  18. Record3 : TRecord3;
  19. end;
  20. var
  21. Record1Outer : TRecord1Outer;
  22. Record2Outer : TRecord2Outer;
  23. Record3Outer : TRecord3Outer;
  24. begin
  25. if PtrUInt(@Record1Outer.Record1) mod 16<>0 then
  26. halt(1);
  27. if PtrUInt(@Record2Outer.Record2) mod 8<>0 then
  28. halt(2);
  29. if PtrUInt(@Record3Outer.Record3) mod 4<>0 then
  30. halt(3);
  31. writeln('ok');
  32. end.