瀏覽代碼

+ added test for local label data access from i8086 inline asm

git-svn-id: trunk@32178 -
nickysn 9 年之前
父節點
當前提交
ce7672b750
共有 2 個文件被更改,包括 39 次插入0 次删除
  1. 1 0
      .gitattributes
  2. 38 0
      tests/test/cpu16/i8086/tlbldat1.pp

+ 1 - 0
.gitattributes

@@ -11474,6 +11474,7 @@ tests/test/cpu16/i8086/thugeptr5.pp svneol=native#text/pascal
 tests/test/cpu16/i8086/thugeptr5a.pp svneol=native#text/pascal
 tests/test/cpu16/i8086/tintr1.pp svneol=native#text/pascal
 tests/test/cpu16/i8086/tintr2.pp svneol=native#text/pascal
+tests/test/cpu16/i8086/tlbldat1.pp svneol=native#text/plain
 tests/test/cpu16/i8086/tmmc.pp svneol=native#text/pascal
 tests/test/cpu16/i8086/tmml.pp svneol=native#text/pascal
 tests/test/cpu16/i8086/tmmm.pp svneol=native#text/pascal

+ 38 - 0
tests/test/cpu16/i8086/tlbldat1.pp

@@ -0,0 +1,38 @@
+{ %cpu=i8086 }
+
+{ test for local label data access from within inline asm }
+
+{ this test is Turbo Pascal 7 compatible }
+
+program tlbldat1;
+label
+  lbl;
+var
+  a, a2, b, b2: Word;
+begin
+  asm
+    mov ax, word ptr [lbl]
+    mov a, ax
+    mov ax, word ptr [lbl + 2]
+    mov a2, ax
+    mov ax, word ptr [@@loc_lbl]
+    mov b, ax
+    mov ax, word ptr [@@loc_lbl + 2]
+    mov b2, ax
+    jmp @@GoOn
+lbl:
+    dw $1234
+    dw $4321
+@@loc_lbl:
+    dw $5678
+    dw $8765
+@@GoOn:
+  end;
+  if (a=$1234) and (a2=$4321) and (b=$5678) and (b2=$8765) then
+    Writeln('Ok!')
+  else
+  begin
+    Writeln('Error');
+    Halt(1);
+  end;
+end.