Browse Source

+ added an i8086 test for the public directive

git-svn-id: trunk@37531 -
nickysn 7 years ago
parent
commit
be3ff9128a
2 changed files with 33 additions and 0 deletions
  1. 1 0
      .gitattributes
  2. 32 0
      tests/test/tasmpublic2.pp

+ 1 - 0
.gitattributes

@@ -12424,6 +12424,7 @@ tests/test/tasm7.pp svneol=native#text/pascal
 tests/test/tasm8.pp svneol=native#text/plain
 tests/test/tasm8.pp svneol=native#text/plain
 tests/test/tasm9.pp svneol=native#text/pascal
 tests/test/tasm9.pp svneol=native#text/pascal
 tests/test/tasmpublic1.pp svneol=native#text/pascal
 tests/test/tasmpublic1.pp svneol=native#text/pascal
+tests/test/tasmpublic2.pp svneol=native#text/pascal
 tests/test/tasmread.pp svneol=native#text/plain
 tests/test/tasmread.pp svneol=native#text/plain
 tests/test/tasout.pp svneol=native#text/plain
 tests/test/tasout.pp svneol=native#text/plain
 tests/test/tassignmentoperator1.pp svneol=native#text/pascal
 tests/test/tassignmentoperator1.pp svneol=native#text/pascal

+ 32 - 0
tests/test/tasmpublic2.pp

@@ -0,0 +1,32 @@
+{ %CPU=i8086 }
+program tasmpublic2;
+
+{$goto on}
+{$asmmode intel}
+
+label
+  test_gLoBaL_label;
+
+var
+  codeseg_var: Word; external name 'test_gLoBaL_label';
+  v: Word;
+
+begin
+  asm
+    public test_gLoBaL_label
+    jmp @@skip
+    db 'some garbage here'
+test_gLoBaL_label:
+    dw 1234h
+@@skip:
+    mov ax, cs:[codeseg_var]
+    mov v, ax
+  end;
+  if v<>$1234 then
+  begin
+    Writeln('Error!');
+    Halt(1);
+  end
+  else
+    Writeln('Ok!');
+end.