X-Git-Url: https://perl5.git.perl.org/perl5.git/blobdiff_plain/7e09e582198d13c19d8edacfdfee681daa3f07a2..fc6e609e613c36ececcd37d4c7f023be35a36578:/t/op/sub.t diff --git a/t/op/sub.t b/t/op/sub.t index a299447..05fd018 100644 --- a/t/op/sub.t +++ b/t/op/sub.t @@ -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');