mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-06-24 17:59:02 +02:00
+ some new tests for the goto checking in exception blocks added
This commit is contained in:
parent
577edbbd3f
commit
4598827d00
@ -53,3 +53,6 @@ testaoc.pp test Array of construct.
|
|||||||
testansi.pp test ansistrings
|
testansi.pp test ansistrings
|
||||||
testrtti.pp test RTTI generation and typinfo unit.
|
testrtti.pp test RTTI generation and typinfo unit.
|
||||||
testexc.pp test exceptions.
|
testexc.pp test exceptions.
|
||||||
|
testi642.pp test int64/qword
|
||||||
|
testpvar.pp test procedure variables
|
||||||
|
testgoto.pp test goto (very simple)
|
||||||
|
24
tests/testgoto.pp
Normal file
24
tests/testgoto.pp
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
|
||||||
|
function test : longint;
|
||||||
|
|
||||||
|
label l;
|
||||||
|
|
||||||
|
|
||||||
|
var
|
||||||
|
a,b : longint;
|
||||||
|
|
||||||
|
begin
|
||||||
|
a:=1;
|
||||||
|
b:=1;
|
||||||
|
l:
|
||||||
|
if a>b then
|
||||||
|
begin
|
||||||
|
exit(0);
|
||||||
|
end;
|
||||||
|
a:=2;
|
||||||
|
goto l;
|
||||||
|
end;
|
||||||
|
|
||||||
|
begin
|
||||||
|
test;
|
||||||
|
end.
|
10
tests/tf/tf000003.pp
Normal file
10
tests/tf/tf000003.pp
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
{$mode objfpc}
|
||||||
|
label l;
|
||||||
|
|
||||||
|
begin
|
||||||
|
try
|
||||||
|
goto l;
|
||||||
|
finally
|
||||||
|
end;
|
||||||
|
l:
|
||||||
|
end.
|
10
tests/tf/tf000004.pp
Normal file
10
tests/tf/tf000004.pp
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
{$mode objfpc}
|
||||||
|
label l;
|
||||||
|
|
||||||
|
begin
|
||||||
|
try
|
||||||
|
finally
|
||||||
|
l:
|
||||||
|
end;
|
||||||
|
goto l;
|
||||||
|
end.
|
10
tests/tf/tf000005.pp
Normal file
10
tests/tf/tf000005.pp
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
{$mode objfpc}
|
||||||
|
label l;
|
||||||
|
|
||||||
|
begin
|
||||||
|
try
|
||||||
|
except
|
||||||
|
goto l;
|
||||||
|
end;
|
||||||
|
l:
|
||||||
|
end.
|
14
tests/tf/tf000006.pp
Normal file
14
tests/tf/tf000006.pp
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
{$mode objfpc}
|
||||||
|
uses
|
||||||
|
sysutils;
|
||||||
|
|
||||||
|
label l;
|
||||||
|
|
||||||
|
begin
|
||||||
|
try
|
||||||
|
except
|
||||||
|
on e : exception do
|
||||||
|
goto l;
|
||||||
|
end;
|
||||||
|
l:
|
||||||
|
end.
|
Loading…
Reference in New Issue
Block a user