瀏覽代碼

+ added test tasm18a.pp, which tests that 3-byte records don't set a valid
operand size in the intel asm syntax mode. In other words, this is not valid:
test [di + a3byterecordtype], 1

git-svn-id: trunk@38190 -

nickysn 7 年之前
父節點
當前提交
3e63f6bbae
共有 2 個文件被更改,包括 36 次插入0 次删除
  1. 1 0
      .gitattributes
  2. 35 0
      tests/test/tasm18a.pp

+ 1 - 0
.gitattributes

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

+ 35 - 0
tests/test/tasm18a.pp

@@ -0,0 +1,35 @@
+{ %FAIL }
+{ %CPU=i8086,i386,x86_64 }
+program tasm18a;
+
+{$ifdef FPC}
+  {$asmmode intel}
+{$else}
+  {$define CPUI8086}
+{$endif FPC}
+
+const
+  cval = 1;
+
+type
+  foo3 = packed record
+    b1: byte;
+    b2: byte;
+    b3: byte;
+  end;
+
+begin
+  asm
+    { this should produce an error, because foo3 is a 3-byte record and there's
+      no explicit operand size specified (i.e. no 'byte ptr' or 'word ptr') }
+{$ifdef CPUI8086}
+    test [di + foo3], cval
+{$endif}
+{$ifdef CPUI386}
+    test [edi + foo3], cval
+{$endif}
+{$ifdef CPUX86_64}
+    test [rdi + foo3], cval
+{$endif}
+  end;
+end.