Browse Source

+ added a test for 32-bit inline asm const operand on i8086, using at&t syntax as well

git-svn-id: trunk@37520 -
nickysn 7 years ago
parent
commit
07eab50afe
2 changed files with 34 additions and 0 deletions
  1. 1 0
      .gitattributes
  2. 33 0
      tests/test/cpu16/i8086/tasm16_32_2.pp

+ 1 - 0
.gitattributes

@@ -12106,6 +12106,7 @@ tests/test/cg/variants/tvarol91.pp svneol=native#text/plain
 tests/test/cg/variants/tvarol94.pp svneol=native#text/plain
 tests/test/cg/variants/tvarol96.pp svneol=native#text/plain
 tests/test/cpu16/i8086/tasm16_32_1.pp svneol=native#text/pascal
+tests/test/cpu16/i8086/tasm16_32_2.pp svneol=native#text/pascal
 tests/test/cpu16/i8086/tasmseg1.pp svneol=native#text/pascal
 tests/test/cpu16/i8086/tfarcal1.pp svneol=native#text/pascal
 tests/test/cpu16/i8086/tfarcal2.pp svneol=native#text/pascal

+ 33 - 0
tests/test/cpu16/i8086/tasm16_32_2.pp

@@ -0,0 +1,33 @@
+{ %cpu=i8086 }
+
+{ i8086 test for correct assembly of 32-bit instructions on the i8086 target }
+
+{ this one tests an instruction with a 32-bit const operand }
+
+program tasm16_32_2;
+
+{$asmmode att}
+{$asmcpu 80386}
+
+var
+  lo_word, hi_word: Word;
+begin
+  asm
+    .byte 0x66, 0x31, 0xc0  { xor eax, eax }
+
+    { the actual instruction being tested: }
+    movl $0x12345678, %eax
+
+    .byte 0x66, 0x50  { push eax }
+
+    popw lo_word
+    popw hi_word
+  end;
+  if (lo_word=$5678) and (hi_word=$1234) then
+    Writeln('Ok!')
+  else
+  begin
+    Writeln('Error!');
+    Halt(1);
+  end;
+end.