Browse Source

+ added test tasm18.pp, which tests instructions with an operand size set
implicitly by a recordtype.recordfield or recordtype constant; test is
i8086-only and NORUN for now, but will be updated later, to actually test the
generated code as well (and more tests will be added for i386 and x86_64 as
well)

git-svn-id: trunk@38177 -

nickysn 7 years ago
parent
commit
cbf01fc284
2 changed files with 51 additions and 0 deletions
  1. 1 0
      .gitattributes
  2. 50 0
      tests/test/tasm18.pp

+ 1 - 0
.gitattributes

@@ -12493,6 +12493,7 @@ tests/test/tasm15.pp svneol=native#text/plain
 tests/test/tasm15a.pp svneol=native#text/plain
 tests/test/tasm15a.pp svneol=native#text/plain
 tests/test/tasm16.pp svneol=native#text/plain
 tests/test/tasm16.pp svneol=native#text/plain
 tests/test/tasm17.pp svneol=native#text/plain
 tests/test/tasm17.pp svneol=native#text/plain
+tests/test/tasm18.pp svneol=native#text/plain
 tests/test/tasm2.inc svneol=native#text/plain
 tests/test/tasm2.inc svneol=native#text/plain
 tests/test/tasm2.pp svneol=native#text/plain
 tests/test/tasm2.pp svneol=native#text/plain
 tests/test/tasm2a.pp svneol=native#text/plain
 tests/test/tasm2a.pp svneol=native#text/plain

+ 50 - 0
tests/test/tasm18.pp

@@ -0,0 +1,50 @@
+{ %NORUN }
+{ %CPU=i8086 }
+program tasm18;
+
+const
+  cval = 1;
+
+type
+  foo = record
+    b1: byte;
+    w: word;
+    b2: byte;
+  end;
+  foo2 = record
+    bb1, bb2: byte;
+  end;
+
+procedure x; assembler;
+asm
+  test [di+foo2], cval                   { test word ptr [di], 1   }
+  test byte ptr [di+foo], cval           { test byte ptr [di], 1   }
+  test [di+foo.w], cval                  { test word ptr [di+1], 1 }
+  test [di+foo.b2], cval                 { test byte ptr [di+3], 1 }
+  test [di-foo.w], cval                  { test word ptr [di-1], 1 }
+  test [di-foo.b2], cval                 { test byte ptr [di-3], 1 }
+  test [di+foo.b2+foo.w], cval           { test word ptr [di+4], 1 }
+  test [di+foo.w+foo.b2], cval           { test byte ptr [di+4], 1 }
+
+  test byte ptr [di+foo2], cval          { test byte ptr [di], 1   }
+  test byte ptr [di+foo], cval           { test byte ptr [di], 1   }
+  test byte ptr [di+foo.w], cval         { test byte ptr [di+1], 1 }
+  test byte ptr [di+foo.b2], cval        { test byte ptr [di+3], 1 }
+  test byte ptr [di-foo.w], cval         { test byte ptr [di-1], 1 }
+  test byte ptr [di-foo.b2], cval        { test byte ptr [di-3], 1 }
+  test byte ptr [di+foo.b2+foo.w], cval  { test byte ptr [di+4], 1 }
+  test byte ptr [di+foo.w+foo.b2], cval  { test byte ptr [di+4], 1 }
+
+  test word ptr [di+foo2], cval          { test word ptr [di], 1   }
+  test word ptr [di+foo], cval           { test word ptr [di], 1   }
+  test word ptr [di+foo.w], cval         { test word ptr [di+1], 1 }
+  test word ptr [di+foo.b2], cval        { test word ptr [di+3], 1 }
+  test word ptr [di-foo.w], cval         { test word ptr [di-1], 1 }
+  test word ptr [di-foo.b2], cval        { test word ptr [di-3], 1 }
+  test word ptr [di+foo.b2+foo.w], cval  { test word ptr [di+4], 1 }
+  test word ptr [di+foo.w+foo.b2], cval  { test word ptr [di+4], 1 }
+end;
+
+begin
+  x;
+end.