From 811d39d9954060e2eccf78147f95db4345d44db5 Mon Sep 17 00:00:00 2001
From: svenbarth <pascaldragon@googlemail.com>
Date: Sun, 28 Jul 2019 19:50:33 +0000
Subject: [PATCH] * correctly align the stream on targets that require proper
 alignment

git-svn-id: trunk@42522 -
---
 tests/test/tcustomattr13.pp | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/tests/test/tcustomattr13.pp b/tests/test/tcustomattr13.pp
index cb855b7372..26af7b3639 100644
--- a/tests/test/tcustomattr13.pp
+++ b/tests/test/tcustomattr13.pp
@@ -75,6 +75,16 @@ begin
 end;
 
 procedure CheckAttr1(aStrm: TStream);
+{$ifdef FPC_REQUIRES_PROPER_ALIGNMENT}
+{$push}
+{$packrecords c}
+type
+  TAlignDummy = record
+    b: Byte;
+    s: Single;
+  end;
+{$pop}
+{$endif}
 var
   b: Byte;
   ss: ShortString;
@@ -93,6 +103,9 @@ begin
     Halt(24);
   if ss <> StrHelloWorld then
     Halt(25);
+{$ifdef FPC_REQUIRES_PROPER_ALIGNMENT}
+  aStrm.Position := Align(PtrUInt(aStrm.Position), PtrInt(@TAlignDummy(nil^).s)));
+{$endif}
   if aStrm.Read(s, SizeOf(Single)) <> SizeOf(Single) then
     Halt(26);
   if s <> Single(SingleVal) then