mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-30 15:00:16 +02:00
+ test that the compiler should not allow non local goto
This commit is contained in:
parent
6b5f84117b
commit
aa9fbc040e
27
tests/tbf/tb0164.pp
Normal file
27
tests/tbf/tb0164.pp
Normal file
@ -0,0 +1,27 @@
|
||||
{ %fail }
|
||||
|
||||
program tb0164;
|
||||
|
||||
{ Non local goto cannot be handled properly by the compiler,
|
||||
and should therefore not be allowed.}
|
||||
|
||||
{$GOTO ON}
|
||||
|
||||
procedure foo;
|
||||
|
||||
label 999;
|
||||
|
||||
procedure bar;
|
||||
|
||||
begin
|
||||
goto 999
|
||||
end;
|
||||
|
||||
begin
|
||||
bar;
|
||||
999:
|
||||
end;
|
||||
|
||||
begin
|
||||
foo;
|
||||
end.
|
Loading…
Reference in New Issue
Block a user