Integrate from mainperl.
[p5sagit/p5-mst-13.2.git] / t / op / goto.t
index a62c899..8096aff 100755 (executable)
@@ -2,7 +2,7 @@
 
 # "This IS structured code.  It's just randomly structured."
 
-print "1..12\n";
+print "1..13\n";
 
 while ($?) {
     $foo = 1;
@@ -54,7 +54,7 @@ sub bar {
 exit;
 
 FINALE:
-print "ok 12\n";
+print "ok 13\n";
 exit;
 
 bypass:
@@ -93,5 +93,13 @@ print $@ =~ /Can't find label NOWHERE/ ? "ok 8\n" : "not ok 8\n";
   for (9..11)  { start(bless([$_]), 'bar'); }
 }
 
+sub auto {
+    goto &loadit;
+}
+
+sub AUTOLOAD { print @_ }
+
+auto("ok 12\n");
+
 $wherever = FINALE;
 goto $wherever;