Browse Source

+ added tests, which check that 'test [reg+const*recordtype], 1' and
'test [reg+const*recordtype.recordfield], 1' produce an 'unable to determine
operand size' error

git-svn-id: trunk@38229 -

nickysn 7 years ago
parent
commit
34c9136283
5 changed files with 152 additions and 0 deletions
  1. 4 0
      .gitattributes
  2. 35 0
      tests/test/tasm18c.pp
  3. 35 0
      tests/test/tasm18d.pp
  4. 39 0
      tests/test/tasm18e.pp
  5. 39 0
      tests/test/tasm18f.pp

+ 4 - 0
.gitattributes

@@ -12504,6 +12504,10 @@ tests/test/tasm17.pp svneol=native#text/plain
 tests/test/tasm18.pp svneol=native#text/plain
 tests/test/tasm18.pp svneol=native#text/plain
 tests/test/tasm18a.pp svneol=native#text/plain
 tests/test/tasm18a.pp svneol=native#text/plain
 tests/test/tasm18b.pp svneol=native#text/plain
 tests/test/tasm18b.pp svneol=native#text/plain
+tests/test/tasm18c.pp svneol=native#text/plain
+tests/test/tasm18d.pp svneol=native#text/plain
+tests/test/tasm18e.pp svneol=native#text/plain
+tests/test/tasm18f.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

+ 35 - 0
tests/test/tasm18c.pp

@@ -0,0 +1,35 @@
+{ %FAIL }
+{ %CPU=i8086,i386,x86_64 }
+program tasm18c;
+
+{$ifdef FPC}
+  {$asmmode intel}
+{$else}
+  {$define CPUI8086}
+{$endif FPC}
+
+const
+  cval = 1;
+
+type
+  foo2 = packed record
+    b1: byte;
+    b2: byte;
+  end;
+
+begin
+  asm
+    { this produces an error in TP7, while 
+        test [di + foo2*1], cval
+      doesn't... go figure :) }
+{$ifdef CPUI8086}
+    test [di + 1*foo2], cval
+{$endif}
+{$ifdef CPUI386}
+    test [edi + 1*foo2], cval
+{$endif}
+{$ifdef CPUX86_64}
+    test [rdi + 1*foo2], cval
+{$endif}
+  end;
+end.

+ 35 - 0
tests/test/tasm18d.pp

@@ -0,0 +1,35 @@
+{ %FAIL }
+{ %CPU=i8086,i386,x86_64 }
+program tasm18d;
+
+{$ifdef FPC}
+  {$asmmode intel}
+{$else}
+  {$define CPUI8086}
+{$endif FPC}
+
+const
+  cval = 1;
+
+type
+  foo2 = packed record
+    b1: byte;
+    b2: byte;
+  end;
+
+begin
+  asm
+    { this produces an error in TP7, while 
+        test [di + foo2*5], cval
+      doesn't... go figure :) }
+{$ifdef CPUI8086}
+    test [di + 5*foo2], cval
+{$endif}
+{$ifdef CPUI386}
+    test [edi + 5*foo2], cval
+{$endif}
+{$ifdef CPUX86_64}
+    test [rdi + 5*foo2], cval
+{$endif}
+  end;
+end.

+ 39 - 0
tests/test/tasm18e.pp

@@ -0,0 +1,39 @@
+{ %FAIL }
+{ %CPU=i8086,i386,x86_64 }
+program tasm18e;
+
+{$ifdef FPC}
+  {$asmmode intel}
+{$else}
+  {$define CPUI8086}
+{$endif FPC}
+
+const
+  cval = 1;
+
+type
+  foo2 = packed record
+    b1: byte;
+    b2: byte;
+  end;
+  foo = packed record
+    bb1: byte;
+    fb2: foo2;
+  end;
+
+begin
+  asm
+    { this produces an error in TP7, while 
+        test [di + 1*foo.fb2], cval
+      doesn't... go figure :) }
+{$ifdef CPUI8086}
+    test [di + 1*foo.fb2], cval
+{$endif}
+{$ifdef CPUI386}
+    test [edi + 1*foo.fb2], cval
+{$endif}
+{$ifdef CPUX86_64}
+    test [rdi + 1*foo.fb2], cval
+{$endif}
+  end;
+end.

+ 39 - 0
tests/test/tasm18f.pp

@@ -0,0 +1,39 @@
+{ %FAIL }
+{ %CPU=i8086,i386,x86_64 }
+program tasm18e;
+
+{$ifdef FPC}
+  {$asmmode intel}
+{$else}
+  {$define CPUI8086}
+{$endif FPC}
+
+const
+  cval = 1;
+
+type
+  foo2 = packed record
+    b1: byte;
+    b2: byte;
+  end;
+  foo = packed record
+    bb1: byte;
+    fb2: foo2;
+  end;
+
+begin
+  asm
+    { this produces an error in TP7, while 
+        test [di + 5*foo.fb2], cval
+      doesn't... go figure :) }
+{$ifdef CPUI8086}
+    test [di + 5*foo.fb2], cval
+{$endif}
+{$ifdef CPUI386}
+    test [edi + 5*foo.fb2], cval
+{$endif}
+{$ifdef CPUX86_64}
+    test [rdi + 5*foo.fb2], cval
+{$endif}
+  end;
+end.