This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
dounwind(): do a POPBLOCK for final cx frame.
[perl5.git] / t / op / sub.t
index a299447..05fd018 100644 (file)
@@ -6,7 +6,7 @@ BEGIN {
     set_up_inc('../lib');
 }
 
-plan(tests => 62);
+plan(tests => 63);
 
 sub empty_sub {}
 
@@ -403,3 +403,15 @@ is(join('-', 10, check_ret(-1,5)),      "10",  "check_ret(-1,5) list");
     sub g { !!(my $x = bless []); }
     f(g());
 }
+
+# return should have the right PL_curpm while copying its return args
+
+sub curpm {
+    "b" =~ /(.)/;
+    {
+        "c" =~ /(.)/;
+        return $1;
+    }
+}
+"a" =~ /(.)/;
+is(curpm(), 'c', 'return and PL_curpm');