Browse Source

+ extended test tasm17.pp with 'DW/DD const+offset x'; unfortunately, TP7 also
supports 'DW/DD offset const+x', which we don't and I don't know whether we
should

git-svn-id: trunk@38164 -

nickysn 7 years ago
parent
commit
d65fb1907a
1 changed files with 21 additions and 0 deletions
  1. 21 0
      tests/test/tasm17.pp

+ 21 - 0
tests/test/tasm17.pp

@@ -17,6 +17,7 @@ const
 
 var
   expect2: array [0..6] of word;
+  expect3: array [0..6] of word;
 
 procedure test1; assembler; {$IFDEF FPC_MM_HUGE}nostackframe;{$ENDIF}
 asm
@@ -36,6 +37,15 @@ asm
   db 55h, 0aah
 end;
 
+procedure test3; assembler; {$IFDEF FPC_MM_HUGE}nostackframe;{$ENDIF}
+asm
+  dw 9+xx
+  dw 11+offset xx
+  dd 12+xx
+  dd 14+offset xx
+  db 55h, 0aah
+end;
+
 procedure Error;
 begin
   Writeln('Error!');
@@ -69,5 +79,16 @@ begin
   expect2[6] := $aa55;
   if not CompareCode(CodePointer(@test2), @expect2, SizeOf(expect2)) then
     Error;
+
+  expect3[0] := Ofs(xx)+9;
+  expect3[1] := Ofs(xx)+11;
+  expect3[2] := Ofs(xx)+12;
+  expect3[3] := Seg(xx);
+  expect3[4] := Ofs(xx)+14;
+  expect3[5] := 0;
+  expect3[6] := $aa55;
+  if not CompareCode(CodePointer(@test3), @expect3, SizeOf(expect3)) then
+    Error;
+
   Writeln('Ok!');
 end.