mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-12-08 04:47:37 +01:00
Check interrupt routine calling
This commit is contained in:
parent
2c86ebf767
commit
a51f97770a
34
tests/test/testintr.pp
Normal file
34
tests/test/testintr.pp
Normal file
@ -0,0 +1,34 @@
|
||||
program test_interrupt;
|
||||
|
||||
|
||||
|
||||
procedure test1;interrupt;
|
||||
begin
|
||||
Writeln('Test1 interrupt');
|
||||
end;
|
||||
|
||||
procedure test2(var a,b : longint);interrupt;
|
||||
begin
|
||||
Writeln('Test2 interrupt');
|
||||
a:=1;
|
||||
b:=2;
|
||||
end;
|
||||
|
||||
function test3 : longint; interrupt;
|
||||
begin
|
||||
Writeln('test3 called');
|
||||
test3:=55;
|
||||
end;
|
||||
|
||||
var
|
||||
x,y : longint;
|
||||
|
||||
begin
|
||||
x:=-1;
|
||||
test1;
|
||||
test2(x,y);
|
||||
if (x<>1) or (y<>2) then
|
||||
Writeln('Error with interrupt');
|
||||
if test3<>55 then
|
||||
Writeln('Error with interrupt function');
|
||||
end.
|
||||
Loading…
Reference in New Issue
Block a user