Browse Source

* test for unaligned function

git-svn-id: trunk@3368 -
florian 19 years ago
parent
commit
f72f9c70eb
2 changed files with 13 additions and 0 deletions
  1. 1 0
      .gitattributes
  2. 12 0
      tests/test/tunaligned1.pp

+ 1 - 0
.gitattributes

@@ -5753,6 +5753,7 @@ tests/test/tstrreal1.pp svneol=native#text/plain
 tests/test/tstrreal2.pp svneol=native#text/plain
 tests/test/tstrreal3.pp -text
 tests/test/tsubdecl.pp svneol=native#text/plain
+tests/test/tunaligned1.pp svneol=native#text/plain
 tests/test/tunit1.pp svneol=native#text/plain
 tests/test/tunit2.pp svneol=native#text/plain
 tests/test/tunit3.pp svneol=native#text/plain

+ 12 - 0
tests/test/tunaligned1.pp

@@ -0,0 +1,12 @@
+var
+  r1 : packed record
+    dummy : byte;
+    a,b : longint;
+  end;
+
+begin
+  r1.a:=unaligned(r1.b)*2;
+  unaligned(r1.a):=r1.b*2;
+  r1.a:=r1.b;
+  r1.a:=r1.b div 10;
+end.