Browse Source

+ extended test tasm17 with 'DW/DD xx+constant' and 'DW/DD OFFSET xx+constant'

git-svn-id: trunk@38155 -
nickysn 7 years ago
parent
commit
0c1062bb45
1 changed files with 22 additions and 0 deletions
  1. 22 0
      tests/test/tasm17.pp

+ 22 - 0
tests/test/tasm17.pp

@@ -15,6 +15,9 @@ const
   expect1: array [0..6] of word =
     (Ofs(xx),Ofs(xx),Ofs(xx),Seg(xx),Ofs(xx),0,$aa55);
 
+var
+  expect2: array [0..6] of word;
+
 procedure test1; assembler;
 asm
   dw xx
@@ -24,6 +27,15 @@ asm
   db 55h, 0aah
 end;
 
+procedure test2; assembler;
+asm
+  dw xx+5
+  dw offset xx+6
+  dd xx+7
+  dd offset xx+8
+  db 55h, 0aah
+end;
+
 procedure Error;
 begin
   Writeln('Error!');
@@ -47,5 +59,15 @@ end;
 begin
   if not CompareCode(CodePointer(@test1), @expect1, SizeOf(expect1)) then
     Error;
+
+  expect2[0] := Ofs(xx)+5;
+  expect2[1] := Ofs(xx)+6;
+  expect2[2] := Ofs(xx)+7;
+  expect2[3] := Seg(xx);
+  expect2[4] := Ofs(xx)+8;
+  expect2[5] := 0;
+  expect2[6] := $aa55;
+  if not CompareCode(CodePointer(@test2), @expect2, SizeOf(expect2)) then
+    Error;
   Writeln('Ok!');
 end.