Преглед изворни кода

+ test that the compiler should not allow non local goto

olle пре 21 година
родитељ
комит
aa9fbc040e
1 измењених фајлова са 27 додато и 0 уклоњено
  1. 27 0
      tests/tbf/tb0164.pp

+ 27 - 0
tests/tbf/tb0164.pp

@@ -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.