瀏覽代碼

* extended test

git-svn-id: trunk@5014 -
Jonas Maebe 19 年之前
父節點
當前提交
751ff8d453
共有 1 個文件被更改,包括 17 次插入5 次删除
  1. 17 5
      tests/test/tmacnonlocalgoto.pp

+ 17 - 5
tests/test/tmacnonlocalgoto.pp

@@ -7,24 +7,35 @@ program tmacnonlocalgoto;
 	var
 		failed: Boolean;
 
-	procedure Global;
+	procedure Global(l: longint);
+        label 2;
 
-		procedure Local;
+		procedure Local(v: longint);
 		begin
-			goto 1;
+                        if (v = 1) then
+				Global(v+1)
+                        else if (v = 3) then
+				goto 2
+			else
+				goto 1;
 			failed := true;
 		end;
 
 	begin
-		Local;
+		Local(l+1);
+	2:
+                if (l <> 2) then
+                  failed := true;
+		Local(5);
 		failed := true;
+        
 	end;
 
 
 begin
 	failed := false;
 
-	Global;
+	Global(0);
 1:
 	if failed then
 		writeln('Failed')
@@ -36,3 +47,4 @@ begin
 		Halt(1);
   {$ENDC}
 end.
+