diff options
author | Matthew Horsfall <WolfSage@gmail.com> | 2014-01-08 21:09:11 -0500 |
---|---|---|
committer | Tony Cook <tony@develop-help.com> | 2014-01-30 11:34:51 +1100 |
commit | c23547d5c65c3ac8b509e78a43d7edc7120604d9 (patch) | |
tree | 66cdd25771be1c4ba0bf414063e7d6ceef0e8e3e /ext | |
parent | 291b9f1d67b97a9ba635385d81f6538739be3f55 (diff) | |
download | perl-c23547d5c65c3ac8b509e78a43d7edc7120604d9.tar.gz |
Optimisation for 'my $x; my $y;' -> 'my ($x, $y)'.
Brings:
sub { my $x; my $y; return 1; }
Up to speed with:
sub { my ($x, $y); return 1; }
Diffstat (limited to 'ext')
-rw-r--r-- | ext/B/t/optree_samples.t | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/ext/B/t/optree_samples.t b/ext/B/t/optree_samples.t index bc682e4115..0e93405732 100644 --- a/ext/B/t/optree_samples.t +++ b/ext/B/t/optree_samples.t @@ -14,7 +14,7 @@ BEGIN { } use OptreeCheck; use Config; -plan tests => 43; +plan tests => 46; pass("GENERAL OPTREE EXAMPLES"); @@ -707,6 +707,25 @@ EOT_EOT # 9 <1> leavesub[1 ref] K/REFC,1 EONT_EONT +pass("rpeep - my $a; my @b; my %c; print 'f'"); + +checkOptree ( name => 'my $a; my @b; my %c; return 1', + code => 'my $a; my @b; my %c; return 1', + bcopts => '-exec', + expect => <<'EOT_EOT', expect_nt => <<'EONT_EONT'); +# 1 <;> nextstate(main 991 (eval 17):1) v +# 2 <0> padrange[$a:991,994; @b:992,994; %c:993,994] vM/LVINTRO,3 +# 3 <;> nextstate(main 994 (eval 17):1) v:{ +# 4 <$> const[IV 1] s +# 5 <1> leavesub[1 ref] K/REFC,1 +EOT_EOT +# 1 <;> nextstate(main 991 (eval 17):1) v +# 2 <0> padrange[$a:991,994; @b:992,994; %c:993,994] vM/LVINTRO,3 +# 3 <;> nextstate(main 994 (eval 17):1) v:{ +# 4 <$> const(IV 1) s +# 5 <1> leavesub[1 ref] K/REFC,1 +EONT_EONT + __END__ ####################################################################### |