summaryrefslogtreecommitdiff
path: root/tests/test/units/system/talign.pp
diff options
context:
space:
mode:
Diffstat (limited to 'tests/test/units/system/talign.pp')
-rw-r--r--tests/test/units/system/talign.pp23
1 files changed, 23 insertions, 0 deletions
diff --git a/tests/test/units/system/talign.pp b/tests/test/units/system/talign.pp
new file mode 100644
index 0000000000..ea39820331
--- /dev/null
+++ b/tests/test/units/system/talign.pp
@@ -0,0 +1,23 @@
+var
+ p: pointer;
+ u: ptruint;
+ i: cardinal;
+begin
+ p:=pointer(1);
+ for i:=0 to 15 do
+ if align(p+i,16)<>pointer(16) then
+ halt(1);
+ p:=pointer(41);
+ for i:=0 to 39 do
+ if align(p+i,40)<>pointer(80) then
+ halt(2);
+
+ u:=1;
+ for i:=0 to 15 do
+ if align(u+i,16)<>16 then
+ halt(3);
+ u:=41;
+ for i:=0 to 39 do
+ if align(u+i,40)<>80 then
+ halt(4);
+end.