summaryrefslogtreecommitdiff
path: root/t/perf
diff options
context:
space:
mode:
authorPaul "LeoNerd" Evans <leonerd@leonerd.org.uk>2022-01-20 14:28:04 +0000
committerPaul Evans <leonerd@leonerd.org.uk>2022-01-20 15:21:23 +0000
commita3338bfd061893135571d7152e21de53e05154c1 (patch)
tree95a70f4c2e5f045c663de99250af97186f6d42e8 /t/perf
parent0b66d70fe7769af01a6bea67bd2ea91b2404eb4b (diff)
downloadperl-a3338bfd061893135571d7152e21de53e05154c1.tar.gz
Make sure to rpeep() the body of catch {} blocks
Diffstat (limited to 't/perf')
-rw-r--r--t/perf/opcount.t12
1 files changed, 12 insertions, 0 deletions
diff --git a/t/perf/opcount.t b/t/perf/opcount.t
index 2d3f196174..372c47f3d6 100644
--- a/t/perf/opcount.t
+++ b/t/perf/opcount.t
@@ -675,6 +675,18 @@ test_opcount(0, "multiconcat: local assign",
});
{
+ use feature 'try';
+ no warnings 'experimental::try';
+
+ test_opcount(0, "try/catch: catch block is optimized",
+ sub { my @a; try {} catch($e) { $a[0] } },
+ {
+ aelemfast_lex => 1,
+ aelem => 0,
+ });
+}
+
+{
use feature 'defer';
no warnings 'experimental::defer';