mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-14 06:29:16 +02:00
+ extended test tasm21.pp, so it actually checks that the instructions it tests
do the right thing git-svn-id: trunk@38293 -
This commit is contained in:
parent
10cbeafd7d
commit
cc3da0979e
@ -5,6 +5,15 @@
|
|||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
program tasm21;
|
program tasm21;
|
||||||
|
|
||||||
|
var
|
||||||
|
test2a_ofs, test2b_ofs: word;
|
||||||
|
|
||||||
|
procedure Error;
|
||||||
|
begin
|
||||||
|
Writeln('Error!');
|
||||||
|
Halt(1);
|
||||||
|
end;
|
||||||
|
|
||||||
function test1a: word; assembler;
|
function test1a: word; assembler;
|
||||||
asm
|
asm
|
||||||
mov ax, offset test1a;
|
mov ax, offset test1a;
|
||||||
@ -14,20 +23,35 @@ function test1b: word;
|
|||||||
begin
|
begin
|
||||||
asm
|
asm
|
||||||
mov ax, offset test1b;
|
mov ax, offset test1b;
|
||||||
|
mov @Result, ax
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure test2a; assembler;
|
procedure test2a; assembler;
|
||||||
asm
|
asm
|
||||||
mov ax, offset test2a;
|
mov ax, offset test2a;
|
||||||
|
mov test2a_ofs, ax
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure test2b;
|
procedure test2b;
|
||||||
begin
|
begin
|
||||||
asm
|
asm
|
||||||
mov ax, offset test2b;
|
mov ax, offset test2b;
|
||||||
|
mov test2b_ofs, ax
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
begin
|
begin
|
||||||
|
if test1a <> Ofs(test1a) then
|
||||||
|
Error;
|
||||||
|
if test1b <> Ofs(test1b) then
|
||||||
|
Error;
|
||||||
|
test2a;
|
||||||
|
if test2a_ofs <> Ofs(test2a) then
|
||||||
|
Error;
|
||||||
|
test2b;
|
||||||
|
if test2b_ofs <> Ofs(test2b) then
|
||||||
|
Error;
|
||||||
|
|
||||||
|
Writeln('Ok!');
|
||||||
end.
|
end.
|
||||||
|
Loading…
Reference in New Issue
Block a user