summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
authorTodd Rinaldo <toddr@cpan.org>2017-09-13 14:35:21 -0500
committerTodd Rinaldo <toddr@cpanel.net>2017-11-08 16:36:16 -0600
commit95d444af8eeefcf058bb763df9a51ae1ba3d8942 (patch)
tree32744fa0c86687a89d87556f4573eba7959afe0a /ext
parent6f1b38bf953ca99a594fc10a4c30a302f2017c93 (diff)
downloadperl-95d444af8eeefcf058bb763df9a51ae1ba3d8942.tar.gz
Remove unnecessary module loads from B and O
This commit removes multiple unnecessary modules so that perl -MO= can hand back to compile as cleanly as possible. This change caused significant jitter in tests for B::Concise. While updating the test to the new reality, OptreeCheck.pm was corrected to stop stripping regexes off $got when it started failing so it would be easier to see where the failure happened.
Diffstat (limited to 'ext')
-rw-r--r--ext/B/B.pm9
-rw-r--r--ext/B/O.pm11
-rw-r--r--ext/B/t/OptreeCheck.pm3
-rw-r--r--ext/B/t/optree_specials.t694
4 files changed, 457 insertions, 260 deletions
diff --git a/ext/B/B.pm b/ext/B/B.pm
index 389f8cdc42..f1a072eb9e 100644
--- a/ext/B/B.pm
+++ b/ext/B/B.pm
@@ -6,11 +6,16 @@
# License or the Artistic License, as specified in the README file.
#
package B;
-use strict;
-require Exporter;
@B::ISA = qw(Exporter);
+# If B is loaded without imports, we do not want to unnecessarily pollute the stash with Exporter.
+sub import {
+ return unless scalar @_ > 1; # Called as a method call.
+ require Exporter;
+ B->export_to_level(1, @_);
+}
+
# walkoptree_slow comes from B.pm (you are there),
# walkoptree comes from B.xs
diff --git a/ext/B/O.pm b/ext/B/O.pm
index 94ee754293..7393441b05 100644
--- a/ext/B/O.pm
+++ b/ext/B/O.pm
@@ -2,8 +2,7 @@ package O;
our $VERSION = '1.02';
-use B qw(minus_c save_BEGINs);
-use Carp;
+use B ();
sub import {
my ($class, @options) = @_;
@@ -21,8 +20,8 @@ sub import {
my $backend = shift (@options);
eval q[
BEGIN {
- minus_c;
- save_BEGINs;
+ B::minus_c;
+ B::save_BEGINs;
}
CHECK {
@@ -51,7 +50,9 @@ sub import {
}
];
if ($@) {
- croak "Loading compiler backend 'B::$backend' failed: $@";
+ my $msg = "$@";
+ require Carp;
+ Carp::croak("Loading compiler backend 'B::$backend' failed: $msg");
}
}
diff --git a/ext/B/t/OptreeCheck.pm b/ext/B/t/OptreeCheck.pm
index e7af99ece1..34d01e1532 100644
--- a/ext/B/t/OptreeCheck.pm
+++ b/ext/B/t/OptreeCheck.pm
@@ -781,8 +781,9 @@ sub reduceDiffs {
my $exp = shift @want;
my $line = shift @got;
# remove matches, and report
- unless ($got =~ s/($rex\n)//msg) {
+ unless ($got =~ s/^($rex\n)//ms) {
_diag("got:\t\t'$line'\nwant:\t $rex\n");
+ last;
}
}
_diag("remainder:\n$got");
diff --git a/ext/B/t/optree_specials.t b/ext/B/t/optree_specials.t
index 83ea44e52d..3f575d51bb 100644
--- a/ext/B/t/optree_specials.t
+++ b/ext/B/t/optree_specials.t
@@ -39,108 +39,183 @@ checkOptree ( name => 'BEGIN',
prog => $src,
strip_open_hints => 1,
expect => <<'EOT_EOT', expect_nt => <<'EONT_EONT');
-# BEGIN 1:
-# a <1> leavesub[1 ref] K/REFC,1 ->(end)
-# - <@> lineseq KP ->a
-# 1 <;> nextstate(B::Concise -275 Concise.pm:356) v:*,&,{,x*,x&,x$,$ ->2
-# 3 <1> require sK/1 ->4
-# 2 <$> const[PV "strict.pm"] s/BARE ->3
-# - <;> ex-nextstate(B::Concise -837 Concise.pm:366) v:*,&,{,x*,x&,x$,$ ->4
-# - <@> lineseq K ->-
-# 4 <;> nextstate(B::Concise -275 Concise.pm:356) :*,&,{,x*,x&,x$,$ ->5
-# 9 <1> entersub[t1] KRS*/TARG,STRICT ->a
-# 5 <0> pushmark s ->6
-# 6 <$> const[PV "strict"] sM ->7
-# 7 <$> const[PV "refs"] sM ->8
-# 8 <.> method_named[PV "unimport"] ->9
+# - <@> lineseq KP ->7
+# 1 <;> nextstate(B::Concise -1151 Concise.pm:116) v:*,&,{,x*,x&,x$,$ ->2
+# 6 <2> sassign sKS/2 ->7
+# 4 <1> srefgen sK/1 ->5
+# - <1> ex-list lKRM ->4
+# 3 <1> rv2gv sKRM/STRICT,1 ->4
+# 2 <#> gv[*STDOUT] s ->3
+# - <1> ex-rv2sv sKRM*/STRICT,1 ->6
+# 5 <#> gvsv[*B::Concise::walkHandle] s ->6
# BEGIN 2:
-# k <1> leavesub[1 ref] K/REFC,1 ->(end)
-# - <@> lineseq K ->k
-# b <;> nextstate(B::Concise -265 Concise.pm:367) v:*,&,x*,x&,x$,$ ->c
-# d <1> require sK/1 ->e
-# c <$> const[PV "strict.pm"] s/BARE ->d
-# - <;> ex-nextstate(B::Concise -812 Concise.pm:386) v:*,&,x*,x&,x$,$ ->e
+# h <1> leavesub[1 ref] K/REFC,1 ->(end)
+# - <@> lineseq K ->h
+# 8 <;> nextstate(B::Concise -1113 Concise.pm:181) v:*,&,x*,x&,x$,$ ->9
+# a <1> require sK/1 ->b
+# 9 <$> const[PV "strict.pm"] s/BARE ->a
+# - <;> ex-nextstate(B::Concise -1113 Concise.pm:181) v:*,&,x*,x&,x$,$ ->b
# - <@> lineseq K ->-
-# e <;> nextstate(B::Concise -265 Concise.pm:367) :*,&,x*,x&,x$,$ ->f
-# j <1> entersub[t1] KRS*/TARG,STRICT ->k
-# f <0> pushmark s ->g
-# g <$> const[PV "strict"] sM ->h
-# h <$> const[PV "refs"] sM ->i
-# i <.> method_named[PV "unimport"] ->j
+# b <;> nextstate(B::Concise -1113 Concise.pm:181) :*,&,x*,x&,x$,$ ->c
+# g <1> entersub[t1] KRS*/TARG,STRICT ->h
+# c <0> pushmark s ->d
+# d <$> const[PV "strict"] sM ->e
+# e <$> const[PV "refs"] sM ->f
+# f <.> method_named[PV "unimport"] ->g
# BEGIN 3:
-# u <1> leavesub[1 ref] K/REFC,1 ->(end)
-# - <@> lineseq KP ->u
-# l <;> nextstate(B::Concise -254 Concise.pm:386) v:*,&,{,x*,x&,x$,$ ->m
-# n <1> require sK/1 ->o
-# m <$> const[PV "warnings.pm"] s/BARE ->n
-# - <;> ex-nextstate(B::Concise -798 Concise.pm:406) v:*,&,{,x*,x&,x$,$ ->o
+# r <1> leavesub[1 ref] K/REFC,1 ->(end)
+# - <@> lineseq K ->r
+# i <;> nextstate(B::Concise -1010 Concise.pm:303) v:*,&,x*,x&,x$,$ ->j
+# k <1> require sK/1 ->l
+# j <$> const[PV "strict.pm"] s/BARE ->k
+# - <;> ex-nextstate(B::Concise -1010 Concise.pm:303) v:*,&,x*,x&,x$,$ ->l
# - <@> lineseq K ->-
-# o <;> nextstate(B::Concise -254 Concise.pm:386) :*,&,{,x*,x&,x$,$ ->p
-# t <1> entersub[t1] KRS*/TARG,STRICT ->u
-# p <0> pushmark s ->q
-# q <$> const[PV "warnings"] sM ->r
-# r <$> const[PV "qw"] sM ->s
-# s <.> method_named[PV "unimport"] ->t
+# l <;> nextstate(B::Concise -1010 Concise.pm:303) :*,&,x*,x&,x$,$ ->m
+# q <1> entersub[t1] KRS*/TARG,STRICT ->r
+# m <0> pushmark s ->n
+# n <$> const[PV "strict"] sM ->o
+# o <$> const[PV "refs"] sM ->p
+# p <.> method_named[PV "unimport"] ->q
# BEGIN 4:
-# y <1> leavesub[1 ref] K/REFC,1 ->(end)
-# - <@> lineseq KP ->y
-# v <;> nextstate(main 2 -e:1) v:>,<,%,{ ->w
-# x <1> postinc[t3] sK/1 ->y
-# - <1> ex-rv2sv sKRM/1 ->x
-# w <#> gvsv[*beg] s ->x
+# 11 <1> leavesub[1 ref] K/REFC,1 ->(end)
+# - <@> lineseq KP ->11
+# s <;> nextstate(B::Concise -963 Concise.pm:368) v:*,&,{,x*,x&,x$,$ ->t
+# u <1> require sK/1 ->v
+# t <$> const[PV "strict.pm"] s/BARE ->u
+# - <;> ex-nextstate(B::Concise -963 Concise.pm:368) v:*,&,{,x*,x&,x$,$ ->v
+# - <@> lineseq K ->-
+# v <;> nextstate(B::Concise -963 Concise.pm:368) :*,&,{,x*,x&,x$,$ ->w
+# 10 <1> entersub[t1] KRS*/TARG,STRICT ->11
+# w <0> pushmark s ->x
+# x <$> const[PV "strict"] sM ->y
+# y <$> const[PV "refs"] sM ->z
+# z <.> method_named[PV "unimport"] ->10
+# BEGIN 5:
+# 1b <1> leavesub[1 ref] K/REFC,1 ->(end)
+# - <@> lineseq K ->1b
+# 12 <;> nextstate(B::Concise -938 Concise.pm:388) v:*,&,x*,x&,x$,$ ->13
+# 14 <1> require sK/1 ->15
+# 13 <$> const[PV "strict.pm"] s/BARE ->14
+# - <;> ex-nextstate(B::Concise -938 Concise.pm:388) v:*,&,x*,x&,x$,$ ->15
+# - <@> lineseq K ->-
+# 15 <;> nextstate(B::Concise -938 Concise.pm:388) :*,&,x*,x&,x$,$ ->16
+# 1a <1> entersub[t1] KRS*/TARG,STRICT ->1b
+# 16 <0> pushmark s ->17
+# 17 <$> const[PV "strict"] sM ->18
+# 18 <$> const[PV "refs"] sM ->19
+# 19 <.> method_named[PV "unimport"] ->1a
+# BEGIN 6:
+# 1l <1> leavesub[1 ref] K/REFC,1 ->(end)
+# - <@> lineseq KP ->1l
+# 1c <;> nextstate(B::Concise -924 Concise.pm:408) v:*,&,{,x*,x&,x$,$ ->1d
+# 1e <1> require sK/1 ->1f
+# 1d <$> const[PV "warnings.pm"] s/BARE ->1e
+# - <;> ex-nextstate(B::Concise -924 Concise.pm:408) v:*,&,{,x*,x&,x$,$ ->1f
+# - <@> lineseq K ->-
+# 1f <;> nextstate(B::Concise -924 Concise.pm:408) :*,&,{,x*,x&,x$,$ ->1g
+# 1k <1> entersub[t1] KRS*/TARG,STRICT ->1l
+# 1g <0> pushmark s ->1h
+# 1h <$> const[PV "warnings"] sM ->1i
+# 1i <$> const[PV "qw"] sM ->1j
+# 1j <.> method_named[PV "unimport"] ->1k
+# BEGIN 7:
+# 1p <1> leavesub[1 ref] K/REFC,1 ->(end)
+# - <@> lineseq KP ->1p
+# 1m <;> nextstate(main 3 -e:1) v:{ ->1n
+# 1o <1> postinc[t3] sK/1 ->1p
+# - <1> ex-rv2sv sKRM/1 ->1o
+# 1n <#> gvsv[*beg] s ->1o
EOT_EOT
# BEGIN 1:
-# a <1> leavesub[1 ref] K/REFC,1 ->(end)
-# - <@> lineseq KP ->a
-# 1 <;> nextstate(B::Concise -275 Concise.pm:356) v:*,&,{,x*,x&,x$,$ ->2
-# 3 <1> require sK/1 ->4
-# 2 <$> const(PV "strict.pm") s/BARE ->3
-# - <;> ex-nextstate(B::Concise -837 Concise.pm:366) v:*,&,{,x*,x&,x$,$ ->4
-# - <@> lineseq K ->-
-# 4 <;> nextstate(B::Concise -275 Concise.pm:356) :*,&,{,x*,x&,x$,$ ->5
-# 9 <1> entersub[t1] KRS*/TARG,STRICT ->a
-# 5 <0> pushmark s ->6
-# 6 <$> const(PV "strict") sM ->7
-# 7 <$> const(PV "refs") sM ->8
-# 8 <.> method_named(PV "unimport") ->9
+# 7 <1> leavesub[1 ref] K/REFC,1 ->(end)
+# - <@> lineseq KP ->7
+# 1 <;> nextstate(B::Concise -1151 Concise.pm:116) v:*,&,{,x*,x&,x$,$ ->2
+# 6 <2> sassign sKS/2 ->7
+# 4 <1> srefgen sK/1 ->5
+# - <1> ex-list lKRM ->4
+# 3 <1> rv2gv sKRM/STRICT,1 ->4
+# 2 <$> gv(*STDOUT) s ->3
+# - <1> ex-rv2sv sKRM*/STRICT,1 ->6
+# 5 <$> gvsv(*B::Concise::walkHandle) s ->6
# BEGIN 2:
-# k <1> leavesub[1 ref] K/REFC,1 ->(end)
-# - <@> lineseq K ->k
-# b <;> nextstate(B::Concise -265 Concise.pm:367) v:*,&,x*,x&,x$,$ ->c
-# d <1> require sK/1 ->e
-# c <$> const(PV "strict.pm") s/BARE ->d
-# - <;> ex-nextstate(B::Concise -812 Concise.pm:386) v:*,&,x*,x&,x$,$ ->e
+# h <1> leavesub[1 ref] K/REFC,1 ->(end)
+# - <@> lineseq K ->h
+# 8 <;> nextstate(B::Concise -1113 Concise.pm:181) v:*,&,x*,x&,x$,$ ->9
+# a <1> require sK/1 ->b
+# 9 <$> const(PV "strict.pm") s/BARE ->a
+# - <;> ex-nextstate(B::Concise -1113 Concise.pm:181) v:*,&,x*,x&,x$,$ ->b
# - <@> lineseq K ->-
-# e <;> nextstate(B::Concise -265 Concise.pm:367) :*,&,x*,x&,x$,$ ->f
-# j <1> entersub[t1] KRS*/TARG,STRICT ->k
-# f <0> pushmark s ->g
-# g <$> const(PV "strict") sM ->h
-# h <$> const(PV "refs") sM ->i
-# i <.> method_named(PV "unimport") ->j
+# b <;> nextstate(B::Concise -1113 Concise.pm:181) :*,&,x*,x&,x$,$ ->c
+# g <1> entersub[t1] KRS*/TARG,STRICT ->h
+# c <0> pushmark s ->d
+# d <$> const(PV "strict") sM ->e
+# e <$> const(PV "refs") sM ->f
+# f <.> method_named(PV "unimport") ->g
# BEGIN 3:
-# u <1> leavesub[1 ref] K/REFC,1 ->(end)
-# - <@> lineseq KP ->u
-# l <;> nextstate(B::Concise -254 Concise.pm:386) v:*,&,{,x*,x&,x$,$ ->m
-# n <1> require sK/1 ->o
-# m <$> const(PV "warnings.pm") s/BARE ->n
-# - <;> ex-nextstate(B::Concise -798 Concise.pm:406) v:*,&,{,x*,x&,x$,$ ->o
+# r <1> leavesub[1 ref] K/REFC,1 ->(end)
+# - <@> lineseq K ->r
+# i <;> nextstate(B::Concise -1010 Concise.pm:303) v:*,&,x*,x&,x$,$ ->j
+# k <1> require sK/1 ->l
+# j <$> const(PV "strict.pm") s/BARE ->k
+# - <;> ex-nextstate(B::Concise -1010 Concise.pm:303) v:*,&,x*,x&,x$,$ ->l
# - <@> lineseq K ->-
-# o <;> nextstate(B::Concise -254 Concise.pm:386) :*,&,{,x*,x&,x$,$ ->p
-# t <1> entersub[t1] KRS*/TARG,STRICT ->u
-# p <0> pushmark s ->q
-# q <$> const(PV "warnings") sM ->r
-# r <$> const(PV "qw") sM ->s
-# s <.> method_named(PV "unimport") ->t
+# l <;> nextstate(B::Concise -1010 Concise.pm:303) :*,&,x*,x&,x$,$ ->m
+# q <1> entersub[t1] KRS*/TARG,STRICT ->r
+# m <0> pushmark s ->n
+# n <$> const(PV "strict") sM ->o
+# o <$> const(PV "refs") sM ->p
+# p <.> method_named(PV "unimport") ->q
# BEGIN 4:
-# y <1> leavesub[1 ref] K/REFC,1 ->(end)
-# - <@> lineseq KP ->y
-# v <;> nextstate(main 2 -e:1) v:>,<,%,{ ->w
-# x <1> postinc[t2] sK/1 ->y
-# - <1> ex-rv2sv sKRM/1 ->x
-# w <$> gvsv(*beg) s ->x
+# 11 <1> leavesub[1 ref] K/REFC,1 ->(end)
+# - <@> lineseq KP ->11
+# s <;> nextstate(B::Concise -963 Concise.pm:368) v:*,&,{,x*,x&,x$,$ ->t
+# u <1> require sK/1 ->v
+# t <$> const(PV "strict.pm") s/BARE ->u
+# - <;> ex-nextstate(B::Concise -963 Concise.pm:368) v:*,&,{,x*,x&,x$,$ ->v
+# - <@> lineseq K ->-
+# v <;> nextstate(B::Concise -963 Concise.pm:368) :*,&,{,x*,x&,x$,$ ->w
+# 10 <1> entersub[t1] KRS*/TARG,STRICT ->11
+# w <0> pushmark s ->x
+# x <$> const(PV "strict") sM ->y
+# y <$> const(PV "refs") sM ->z
+# z <.> method_named(PV "unimport") ->10
+# BEGIN 5:
+# 1b <1> leavesub[1 ref] K/REFC,1 ->(end)
+# - <@> lineseq K ->1b
+# 12 <;> nextstate(B::Concise -938 Concise.pm:388) v:*,&,x*,x&,x$,$ ->13
+# 14 <1> require sK/1 ->15
+# 13 <$> const(PV "strict.pm") s/BARE ->14
+# - <;> ex-nextstate(B::Concise -938 Concise.pm:388) v:*,&,x*,x&,x$,$ ->15
+# - <@> lineseq K ->-
+# 15 <;> nextstate(B::Concise -938 Concise.pm:388) :*,&,x*,x&,x$,$ ->16
+# 1a <1> entersub[t1] KRS*/TARG,STRICT ->1b
+# 16 <0> pushmark s ->17
+# 17 <$> const(PV "strict") sM ->18
+# 18 <$> const(PV "refs") sM ->19
+# 19 <.> method_named(PV "unimport") ->1a
+# BEGIN 6:
+# 1l <1> leavesub[1 ref] K/REFC,1 ->(end)
+# - <@> lineseq KP ->1l
+# 1c <;> nextstate(B::Concise -924 Concise.pm:408) v:*,&,{,x*,x&,x$,$ ->1d
+# 1e <1> require sK/1 ->1f
+# 1d <$> const(PV "warnings.pm") s/BARE ->1e
+# - <;> ex-nextstate(B::Concise -924 Concise.pm:408) v:*,&,{,x*,x&,x$,$ ->1f
+# - <@> lineseq K ->-
+# 1f <;> nextstate(B::Concise -924 Concise.pm:408) :*,&,{,x*,x&,x$,$ ->1g
+# 1k <1> entersub[t1] KRS*/TARG,STRICT ->1l
+# 1g <0> pushmark s ->1h
+# 1h <$> const(PV "warnings") sM ->1i
+# 1i <$> const(PV "qw") sM ->1j
+# 1j <.> method_named(PV "unimport") ->1k
+# BEGIN 7:
+# 1p <1> leavesub[1 ref] K/REFC,1 ->(end)
+# - <@> lineseq KP ->1p
+# 1m <;> nextstate(main 3 -e:1) v:{ ->1n
+# 1o <1> postinc[t2] sK/1 ->1p
+# - <1> ex-rv2sv sKRM/1 ->1o
+# 1n <$> gvsv(*beg) s ->1o
EONT_EONT
-
checkOptree ( name => 'END',
bcopts => 'END',
prog => $src,
@@ -163,7 +238,6 @@ EOT_EOT
# 2 <$> gvsv(*end) s ->3
EONT_EONT
-
checkOptree ( name => 'CHECK',
bcopts => 'CHECK',
prog => $src,
@@ -231,205 +305,321 @@ EOT_EOT
# 2 <$> gvsv(*init) s ->3
EONT_EONT
-
checkOptree ( name => 'all of BEGIN END INIT CHECK UNITCHECK -exec',
bcopts => [qw/ BEGIN END INIT CHECK UNITCHECK -exec /],
prog => $src,
strip_open_hints => 1,
expect => <<'EOT_EOT', expect_nt => <<'EONT_EONT');
# BEGIN 1:
-# 1 <;> nextstate(B::Concise -275 Concise.pm:356) v:*,&,{,x*,x&,x$,$
-# 2 <$> const[PV "strict.pm"] s/BARE
-# 3 <1> require sK/1
-# 4 <;> nextstate(B::Concise -275 Concise.pm:356) :*,&,{,x*,x&,x$,$
-# 5 <0> pushmark s
-# 6 <$> const[PV "strict"] sM
-# 7 <$> const[PV "refs"] sM
-# 8 <.> method_named[PV "unimport"]
-# 9 <1> entersub[t1] KRS*/TARG,STRICT
-# a <1> leavesub[1 ref] K/REFC,1
+# 1 <;> nextstate(B::Concise -1151 Concise.pm:116) v:*,&,{,x*,x&,x$,$
+# 2 <#> gv[*STDOUT] s
+# 3 <1> rv2gv sKRM/STRICT,1
+# 4 <1> srefgen sK/1
+# 5 <#> gvsv[*B::Concise::walkHandle] s
+# 6 <2> sassign sKS/2
+# 7 <1> leavesub[1 ref] K/REFC,1
# BEGIN 2:
-# b <;> nextstate(B::Concise -265 Concise.pm:367) v:*,&,x*,x&,x$,$
-# c <$> const[PV "strict.pm"] s/BARE
-# d <1> require sK/1
-# e <;> nextstate(B::Concise -265 Concise.pm:367) :*,&,x*,x&,x$,$
-# f <0> pushmark s
-# g <$> const[PV "strict"] sM
-# h <$> const[PV "refs"] sM
-# i <.> method_named[PV "unimport"]
-# j <1> entersub[t1] KRS*/TARG,STRICT
-# k <1> leavesub[1 ref] K/REFC,1
+# 8 <;> nextstate(B::Concise -1113 Concise.pm:181) v:*,&,x*,x&,x$,$
+# 9 <$> const[PV "strict.pm"] s/BARE
+# a <1> require sK/1
+# b <;> nextstate(B::Concise -1113 Concise.pm:181) :*,&,x*,x&,x$,$
+# c <0> pushmark s
+# d <$> const[PV "strict"] sM
+# e <$> const[PV "refs"] sM
+# f <.> method_named[PV "unimport"]
+# g <1> entersub[t1] KRS*/TARG,STRICT
+# h <1> leavesub[1 ref] K/REFC,1
# BEGIN 3:
-# l <;> nextstate(B::Concise -254 Concise.pm:386) v:*,&,{,x*,x&,x$,$
-# m <$> const[PV "warnings.pm"] s/BARE
-# n <1> require sK/1
-# o <;> nextstate(B::Concise -254 Concise.pm:386) :*,&,{,x*,x&,x$,$
-# p <0> pushmark s
-# q <$> const[PV "warnings"] sM
-# r <$> const[PV "qw"] sM
-# s <.> method_named[PV "unimport"]
-# t <1> entersub[t1] KRS*/TARG,STRICT
-# u <1> leavesub[1 ref] K/REFC,1
+# i <;> nextstate(B::Concise -1010 Concise.pm:303) v:*,&,x*,x&,x$,$
+# j <$> const[PV "strict.pm"] s/BARE
+# k <1> require sK/1
+# l <;> nextstate(B::Concise -1010 Concise.pm:303) :*,&,x*,x&,x$,$
+# m <0> pushmark s
+# n <$> const[PV "strict"] sM
+# o <$> const[PV "refs"] sM
+# p <.> method_named[PV "unimport"]
+# q <1> entersub[t1] KRS*/TARG,STRICT
+# r <1> leavesub[1 ref] K/REFC,1
# BEGIN 4:
-# v <;> nextstate(main 2 -e:1) v:>,<,%,{
-# w <#> gvsv[*beg] s
-# x <1> postinc[t3] sK/1
-# y <1> leavesub[1 ref] K/REFC,1
+# s <;> nextstate(B::Concise -963 Concise.pm:368) v:*,&,{,x*,x&,x$,$
+# t <$> const[PV "strict.pm"] s/BARE
+# u <1> require sK/1
+# v <;> nextstate(B::Concise -963 Concise.pm:368) :*,&,{,x*,x&,x$,$
+# w <0> pushmark s
+# x <$> const[PV "strict"] sM
+# y <$> const[PV "refs"] sM
+# z <.> method_named[PV "unimport"]
+# 10 <1> entersub[t1] KRS*/TARG,STRICT
+# 11 <1> leavesub[1 ref] K/REFC,1
+# BEGIN 5:
+# 12 <;> nextstate(B::Concise -938 Concise.pm:388) v:*,&,x*,x&,x$,$
+# 13 <$> const[PV "strict.pm"] s/BARE
+# 14 <1> require sK/1
+# 15 <;> nextstate(B::Concise -938 Concise.pm:388) :*,&,x*,x&,x$,$
+# 16 <0> pushmark s
+# 17 <$> const[PV "strict"] sM
+# 18 <$> const[PV "refs"] sM
+# 19 <.> method_named[PV "unimport"]
+# 1a <1> entersub[t1] KRS*/TARG,STRICT
+# 1b <1> leavesub[1 ref] K/REFC,1
+# BEGIN 6:
+# 1c <;> nextstate(B::Concise -924 Concise.pm:408) v:*,&,{,x*,x&,x$,$
+# 1d <$> const[PV "warnings.pm"] s/BARE
+# 1e <1> require sK/1
+# 1f <;> nextstate(B::Concise -924 Concise.pm:408) :*,&,{,x*,x&,x$,$
+# 1g <0> pushmark s
+# 1h <$> const[PV "warnings"] sM
+# 1i <$> const[PV "qw"] sM
+# 1j <.> method_named[PV "unimport"]
+# 1k <1> entersub[t1] KRS*/TARG,STRICT
+# 1l <1> leavesub[1 ref] K/REFC,1
+# BEGIN 7:
+# 1m <;> nextstate(main 3 -e:1) v:{
+# 1n <#> gvsv[*beg] s
+# 1o <1> postinc[t3] sK/1
+# 1p <1> leavesub[1 ref] K/REFC,1
# END 1:
-# z <;> nextstate(main 5 -e:1) v:>,<,%,{
-# 10 <#> gvsv[*end] s
-# 11 <1> postinc[t3] sK/1
-# 12 <1> leavesub[1 ref] K/REFC,1
+# 1q <;> nextstate(main 9 -e:1) v:{
+# 1r <#> gvsv[*end] s
+# 1s <1> postinc[t3] sK/1
+# 1t <1> leavesub[1 ref] K/REFC,1
# INIT 1:
-# 13 <;> nextstate(main 4 -e:1) v:>,<,%,{
-# 14 <#> gvsv[*init] s
-# 15 <1> postinc[t3] sK/1
-# 16 <1> leavesub[1 ref] K/REFC,1
+# 1u <;> nextstate(main 7 -e:1) v:{
+# 1v <#> gvsv[*init] s
+# 1w <1> postinc[t3] sK/1
+# 1x <1> leavesub[1 ref] K/REFC,1
# CHECK 1:
-# 17 <;> nextstate(main 3 -e:1) v:>,<,%,{
-# 18 <#> gvsv[*chk] s
-# 19 <1> postinc[t3] sK/1
-# 1a <1> leavesub[1 ref] K/REFC,1
+# 1y <;> nextstate(main 5 -e:1) v:{
+# 1z <#> gvsv[*chk] s
+# 20 <1> postinc[t3] sK/1
+# 21 <1> leavesub[1 ref] K/REFC,1
# UNITCHECK 1:
-# 1b <;> nextstate(main 6 -e:1) v:>,<,%,{
-# 1c <#> gvsv[*uc] s
-# 1d <1> postinc[t3] sK/1
-# 1e <1> leavesub[1 ref] K/REFC,1
+# 22 <;> nextstate(main 11 -e:1) v:{
+# 23 <#> gvsv[*uc] s
+# 24 <1> postinc[t3] sK/1
+# 25 <1> leavesub[1 ref] K/REFC,1
EOT_EOT
# BEGIN 1:
-# 1 <;> nextstate(B::Concise -275 Concise.pm:356) v:*,&,{,x*,x&,x$,$
-# 2 <$> const(PV "strict.pm") s/BARE
-# 3 <1> require sK/1
-# 4 <;> nextstate(B::Concise -275 Concise.pm:356) :*,&,{,x*,x&,x$,$
-# 5 <0> pushmark s
-# 6 <$> const(PV "strict") sM
-# 7 <$> const(PV "refs") sM
-# 8 <.> method_named(PV "unimport")
-# 9 <1> entersub[t1] KRS*/TARG,STRICT
-# a <1> leavesub[1 ref] K/REFC,1
+# 1 <;> nextstate(B::Concise -1151 Concise.pm:116) v:*,&,{,x*,x&,x$,$
+# 2 <$> gv(*STDOUT) s
+# 3 <1> rv2gv sKRM/STRICT,1
+# 4 <1> srefgen sK/1
+# 5 <$> gvsv(*B::Concise::walkHandle) s
+# 6 <2> sassign sKS/2
+# 7 <1> leavesub[1 ref] K/REFC,1
# BEGIN 2:
-# b <;> nextstate(B::Concise -265 Concise.pm:367) v:*,&,x*,x&,x$,$
-# c <$> const(PV "strict.pm") s/BARE
-# d <1> require sK/1
-# e <;> nextstate(B::Concise -265 Concise.pm:367) :*,&,x*,x&,x$,$
-# f <0> pushmark s
-# g <$> const(PV "strict") sM
-# h <$> const(PV "refs") sM
-# i <.> method_named(PV "unimport")
-# j <1> entersub[t1] KRS*/TARG,STRICT
-# k <1> leavesub[1 ref] K/REFC,1
+# 8 <;> nextstate(B::Concise -1113 Concise.pm:181) v:*,&,x*,x&,x$,$
+# 9 <$> const(PV "strict.pm") s/BARE
+# a <1> require sK/1
+# b <;> nextstate(B::Concise -1113 Concise.pm:181) :*,&,x*,x&,x$,$
+# c <0> pushmark s
+# d <$> const(PV "strict") sM
+# e <$> const(PV "refs") sM
+# f <.> method_named(PV "unimport")
+# g <1> entersub[t1] KRS*/TARG,STRICT
+# h <1> leavesub[1 ref] K/REFC,1
# BEGIN 3:
-# l <;> nextstate(B::Concise -254 Concise.pm:386) v:*,&,{,x*,x&,x$,$
-# m <$> const(PV "warnings.pm") s/BARE
-# n <1> require sK/1
-# o <;> nextstate(B::Concise -254 Concise.pm:386) :*,&,{,x*,x&,x$,$
-# p <0> pushmark s
-# q <$> const(PV "warnings") sM
-# r <$> const(PV "qw") sM
-# s <.> method_named(PV "unimport")
-# t <1> entersub[t1] KRS*/TARG,STRICT
-# u <1> leavesub[1 ref] K/REFC,1
+# i <;> nextstate(B::Concise -1010 Concise.pm:303) v:*,&,x*,x&,x$,$
+# j <$> const(PV "strict.pm") s/BARE
+# k <1> require sK/1
+# l <;> nextstate(B::Concise -1010 Concise.pm:303) :*,&,x*,x&,x$,$
+# m <0> pushmark s
+# n <$> const(PV "strict") sM
+# o <$> const(PV "refs") sM
+# p <.> method_named(PV "unimport")
+# q <1> entersub[t1] KRS*/TARG,STRICT
+# r <1> leavesub[1 ref] K/REFC,1
# BEGIN 4:
-# v <;> nextstate(main 2 -e:1) v:>,<,%,{
-# w <$> gvsv(*beg) s
-# x <1> postinc[t2] sK/1
-# y <1> leavesub[1 ref] K/REFC,1
+# s <;> nextstate(B::Concise -963 Concise.pm:368) v:*,&,{,x*,x&,x$,$
+# t <$> const(PV "strict.pm") s/BARE
+# u <1> require sK/1
+# v <;> nextstate(B::Concise -963 Concise.pm:368) :*,&,{,x*,x&,x$,$
+# w <0> pushmark s
+# x <$> const(PV "strict") sM
+# y <$> const(PV "refs") sM
+# z <.> method_named(PV "unimport")
+# 10 <1> entersub[t1] KRS*/TARG,STRICT
+# 11 <1> leavesub[1 ref] K/REFC,1
+# BEGIN 5:
+# 12 <;> nextstate(B::Concise -938 Concise.pm:388) v:*,&,x*,x&,x$,$
+# 13 <$> const(PV "strict.pm") s/BARE
+# 14 <1> require sK/1
+# 15 <;> nextstate(B::Concise -938 Concise.pm:388) :*,&,x*,x&,x$,$
+# 16 <0> pushmark s
+# 17 <$> const(PV "strict") sM
+# 18 <$> const(PV "refs") sM
+# 19 <.> method_named(PV "unimport")
+# 1a <1> entersub[t1] KRS*/TARG,STRICT
+# 1b <1> leavesub[1 ref] K/REFC,1
+# BEGIN 6:
+# 1c <;> nextstate(B::Concise -924 Concise.pm:408) v:*,&,{,x*,x&,x$,$
+# 1d <$> const(PV "warnings.pm") s/BARE
+# 1e <1> require sK/1
+# 1f <;> nextstate(B::Concise -924 Concise.pm:408) :*,&,{,x*,x&,x$,$
+# 1g <0> pushmark s
+# 1h <$> const(PV "warnings") sM
+# 1i <$> const(PV "qw") sM
+# 1j <.> method_named(PV "unimport")
+# 1k <1> entersub[t1] KRS*/TARG,STRICT
+# 1l <1> leavesub[1 ref] K/REFC,1
+# BEGIN 7:
+# 1m <;> nextstate(main 3 -e:1) v:{
+# 1n <$> gvsv(*beg) s
+# 1o <1> postinc[t2] sK/1
+# 1p <1> leavesub[1 ref] K/REFC,1
# END 1:
-# z <;> nextstate(main 5 -e:1) v:>,<,%,{
-# 10 <$> gvsv(*end) s
-# 11 <1> postinc[t2] sK/1
-# 12 <1> leavesub[1 ref] K/REFC,1
+# 1q <;> nextstate(main 9 -e:1) v:{
+# 1r <$> gvsv(*end) s
+# 1s <1> postinc[t2] sK/1
+# 1t <1> leavesub[1 ref] K/REFC,1
# INIT 1:
-# 13 <;> nextstate(main 4 -e:1) v:>,<,%,{
-# 14 <$> gvsv(*init) s
-# 15 <1> postinc[t2] sK/1
-# 16 <1> leavesub[1 ref] K/REFC,1
+# 1u <;> nextstate(main 7 -e:1) v:{
+# 1v <$> gvsv(*init) s
+# 1w <1> postinc[t2] sK/1
+# 1x <1> leavesub[1 ref] K/REFC,1
# CHECK 1:
-# 17 <;> nextstate(main 3 -e:1) v:>,<,%,{
-# 18 <$> gvsv(*chk) s
-# 19 <1> postinc[t2] sK/1
-# 1a <1> leavesub[1 ref] K/REFC,1
+# 1y <;> nextstate(main 5 -e:1) v:{
+# 1z <$> gvsv(*chk) s
+# 20 <1> postinc[t2] sK/1
+# 21 <1> leavesub[1 ref] K/REFC,1
# UNITCHECK 1:
-# 1b <;> nextstate(main 6 -e:1) v:>,<,%,{
-# 1c <$> gvsv(*uc) s
-# 1d <1> postinc[t2] sK/1
-# 1e <1> leavesub[1 ref] K/REFC,1
+# 22 <;> nextstate(main 11 -e:1) v:{
+# 23 <$> gvsv(*uc) s
+# 24 <1> postinc[t2] sK/1
+# 25 <1> leavesub[1 ref] K/REFC,1
EONT_EONT
-
# perl "-I../lib" -MO=Concise,BEGIN,CHECK,INIT,END,-exec -e '$a=$b && print q/foo/'
-
-
checkOptree ( name => 'regression test for patch 25352',
bcopts => [qw/ BEGIN END INIT CHECK -exec /],
prog => 'print q/foo/',
expect => <<'EOT_EOT', expect_nt => <<'EONT_EONT');
# BEGIN 1:
# 1 <;> nextstate(B::Concise -275 Concise.pm:356) v:*,&,{,x*,x&,x$,$
-# 2 <$> const[PV "strict.pm"] s/BARE
-# 3 <1> require sK/1
-# 4 <;> nextstate(B::Concise -275 Concise.pm:356) :*,&,{,x*,x&,x$,$
-# 5 <0> pushmark s
-# 6 <$> const[PV "strict"] sM
-# 7 <$> const[PV "refs"] sM
-# 8 <.> method_named[PV "unimport"]
-# 9 <1> entersub[t1] KRS*/TARG,STRICT
-# a <1> leavesub[1 ref] K/REFC,1
+# 2 <#> gv[*STDOUT] s
+# 3 <1> rv2gv sKRM/STRICT,1
+# 4 <1> srefgen sK/1
+# 5 <#> gvsv[*B::Concise::walkHandle] s
+# 6 <2> sassign sKS/2
+# 7 <1> leavesub[1 ref] K/REFC,1
# BEGIN 2:
-# b <;> nextstate(B::Concise -265 Concise.pm:367) v:*,&,x*,x&,x$,$
-# c <$> const[PV "strict.pm"] s/BARE
-# d <1> require sK/1
-# e <;> nextstate(B::Concise -265 Concise.pm:367) :*,&,x*,x&,x$,$
-# f <0> pushmark s
-# g <$> const[PV "strict"] sM
-# h <$> const[PV "refs"] sM
-# i <.> method_named[PV "unimport"]
-# j <1> entersub[t1] KRS*/TARG,STRICT
-# k <1> leavesub[1 ref] K/REFC,1
+# 8 <;> nextstate(B::Concise -1113 Concise.pm:181) v:*,&,x*,x&,x$,$
+# 9 <$> const[PV "strict.pm"] s/BARE
+# a <1> require sK/1
+# b <;> nextstate(B::Concise -1113 Concise.pm:181) :*,&,x*,x&,x$,$
+# c <0> pushmark s
+# d <$> const[PV "strict"] sM
+# e <$> const[PV "refs"] sM
+# f <.> method_named[PV "unimport"]
+# g <1> entersub[t1] KRS*/TARG,STRICT
+# h <1> leavesub[1 ref] K/REFC,1
# BEGIN 3:
-# l <;> nextstate(B::Concise -254 Concise.pm:386) v:*,&,{,x*,x&,x$,$
-# m <$> const[PV "warnings.pm"] s/BARE
-# n <1> require sK/1
-# o <;> nextstate(B::Concise -254 Concise.pm:386) :*,&,{,x*,x&,x$,$
-# p <0> pushmark s
-# q <$> const[PV "warnings"] sM
-# r <$> const[PV "qw"] sM
-# s <.> method_named[PV "unimport"]
-# t <1> entersub[t1] KRS*/TARG,STRICT
-# u <1> leavesub[1 ref] K/REFC,1
+# i <;> nextstate(B::Concise -1010 Concise.pm:303) v:*,&,x*,x&,x$,$
+# j <$> const[PV "strict.pm"] s/BARE
+# k <1> require sK/1
+# l <;> nextstate(B::Concise -1010 Concise.pm:303) :*,&,x*,x&,x$,$
+# m <0> pushmark s
+# n <$> const[PV "strict"] sM
+# o <$> const[PV "refs"] sM
+# p <.> method_named[PV "unimport"]
+# q <1> entersub[t1] KRS*/TARG,STRICT
+# r <1> leavesub[1 ref] K/REFC,1
+# BEGIN 4:
+# s <;> nextstate(B::Concise -963 Concise.pm:368) v:*,&,{,x*,x&,x$,$
+# t <$> const[PV "strict.pm"] s/BARE
+# u <1> require sK/1
+# v <;> nextstate(B::Concise -963 Concise.pm:368) :*,&,{,x*,x&,x$,$
+# w <0> pushmark s
+# x <$> const[PV "strict"] sM
+# y <$> const[PV "refs"] sM
+# z <.> method_named[PV "unimport"]
+# 10 <1> entersub[t1] KRS*/TARG,STRICT
+# 11 <1> leavesub[1 ref] K/REFC,1
+# BEGIN 5:
+# 12 <;> nextstate(B::Concise -938 Concise.pm:388) v:*,&,x*,x&,x$,$
+# 13 <$> const[PV "strict.pm"] s/BARE
+# 14 <1> require sK/1
+# 15 <;> nextstate(B::Concise -938 Concise.pm:388) :*,&,x*,x&,x$,$
+# 16 <0> pushmark s
+# 17 <$> const[PV "strict"] sM
+# 18 <$> const[PV "refs"] sM
+# 19 <.> method_named[PV "unimport"]
+# 1a <1> entersub[t1] KRS*/TARG,STRICT
+# 1b <1> leavesub[1 ref] K/REFC,1
+# BEGIN 6:
+# 1c <;> nextstate(B::Concise -924 Concise.pm:408) v:*,&,{,x*,x&,x$,$
+# 1d <$> const[PV "warnings.pm"] s/BARE
+# 1e <1> require sK/1
+# 1f <;> nextstate(B::Concise -924 Concise.pm:408) :*,&,{,x*,x&,x$,$
+# 1g <0> pushmark s
+# 1h <$> const[PV "warnings"] sM
+# 1i <$> const[PV "qw"] sM
+# 1j <.> method_named[PV "unimport"]
+# 1k <1> entersub[t1] KRS*/TARG,STRICT
+# 1l <1> leavesub[1 ref] K/REFC,1
EOT_EOT
# BEGIN 1:
-# 1 <;> nextstate(B::Concise -275 Concise.pm:356) v:*,&,{,x*,x&,x$,$
-# 2 <$> const(PV "strict.pm") s/BARE
-# 3 <1> require sK/1
-# 4 <;> nextstate(B::Concise -275 Concise.pm:356) :*,&,{,x*,x&,x$,$
-# 5 <0> pushmark s
-# 6 <$> const(PV "strict") sM
-# 7 <$> const(PV "refs") sM
-# 8 <.> method_named(PV "unimport")
-# 9 <1> entersub[t1] KRS*/TARG,STRICT
-# a <1> leavesub[1 ref] K/REFC,1
+# 1 <;> nextstate(B::Concise -1151 Concise.pm:116) v:*,&,{,x*,x&,x$,$
+# 2 <$> gv(*STDOUT) s
+# 3 <1> rv2gv sKRM/STRICT,1
+# 4 <1> srefgen sK/1
+# 5 <$> gvsv(*B::Concise::walkHandle) s
+# 6 <2> sassign sKS/2
+# 7 <1> leavesub[1 ref] K/REFC,1
# BEGIN 2:
-# b <;> nextstate(B::Concise -265 Concise.pm:367) v:*,&,x*,x&,x$,$
-# c <$> const(PV "strict.pm") s/BARE
-# d <1> require sK/1
-# e <;> nextstate(B::Concise -265 Concise.pm:367) :*,&,x*,x&,x$,$
-# f <0> pushmark s
-# g <$> const(PV "strict") sM
-# h <$> const(PV "refs") sM
-# i <.> method_named(PV "unimport")
-# j <1> entersub[t1] KRS*/TARG,STRICT
-# k <1> leavesub[1 ref] K/REFC,1
+# 8 <;> nextstate(B::Concise -1113 Concise.pm:181) v:*,&,x*,x&,x$,$
+# 9 <$> const(PV "strict.pm") s/BARE
+# a <1> require sK/1
+# b <;> nextstate(B::Concise -1113 Concise.pm:181) :*,&,x*,x&,x$,$
+# c <0> pushmark s
+# d <$> const(PV "strict") sM
+# e <$> const(PV "refs") sM
+# f <.> method_named(PV "unimport")
+# g <1> entersub[t1] KRS*/TARG,STRICT
+# h <1> leavesub[1 ref] K/REFC,1
# BEGIN 3:
-# l <;> nextstate(B::Concise -254 Concise.pm:386) v:*,&,{,x*,x&,x$,$
-# m <$> const(PV "warnings.pm") s/BARE
-# n <1> require sK/1
-# o <;> nextstate(B::Concise -254 Concise.pm:386) :*,&,{,x*,x&,x$,$
-# p <0> pushmark s
-# q <$> const(PV "warnings") sM
-# r <$> const(PV "qw") sM
-# s <.> method_named(PV "unimport")
-# t <1> entersub[t1] KRS*/TARG,STRICT
-# u <1> leavesub[1 ref] K/REFC,1
+# i <;> nextstate(B::Concise -1010 Concise.pm:303) v:*,&,x*,x&,x$,$
+# j <$> const(PV "strict.pm") s/BARE
+# k <1> require sK/1
+# l <;> nextstate(B::Concise -1010 Concise.pm:303) :*,&,x*,x&,x$,$
+# m <0> pushmark s
+# n <$> const(PV "strict") sM
+# o <$> const(PV "refs") sM
+# p <.> method_named(PV "unimport")
+# q <1> entersub[t1] KRS*/TARG,STRICT
+# r <1> leavesub[1 ref] K/REFC,1
+# BEGIN 4:
+# s <;> nextstate(B::Concise -963 Concise.pm:368) v:*,&,{,x*,x&,x$,$
+# t <$> const(PV "strict.pm") s/BARE
+# u <1> require sK/1
+# v <;> nextstate(B::Concise -963 Concise.pm:368) :*,&,{,x*,x&,x$,$
+# w <0> pushmark s
+# x <$> const(PV "strict") sM
+# y <$> const(PV "refs") sM
+# z <.> method_named(PV "unimport")
+# 10 <1> entersub[t1] KRS*/TARG,STRICT
+# 11 <1> leavesub[1 ref] K/REFC,1
+# BEGIN 5:
+# 12 <;> nextstate(B::Concise -938 Concise.pm:388) v:*,&,x*,x&,x$,$
+# 13 <$> const(PV "strict.pm") s/BARE
+# 14 <1> require sK/1
+# 15 <;> nextstate(B::Concise -938 Concise.pm:388) :*,&,x*,x&,x$,$
+# 16 <0> pushmark s
+# 17 <$> const(PV "strict") sM
+# 18 <$> const(PV "refs") sM
+# 19 <.> method_named(PV "unimport")
+# 1a <1> entersub[t1] KRS*/TARG,STRICT
+# 1b <1> leavesub[1 ref] K/REFC,1
+# BEGIN 6:
+# 1c <;> nextstate(B::Concise -924 Concise.pm:408) v:*,&,{,x*,x&,x$,$
+# 1d <$> const(PV "warnings.pm") s/BARE
+# 1e <1> require sK/1
+# 1f <;> nextstate(B::Concise -924 Concise.pm:408) :*,&,{,x*,x&,x$,$
+# 1g <0> pushmark s
+# 1h <$> const(PV "warnings") sM
+# 1i <$> const(PV "qw") sM
+# 1j <.> method_named(PV "unimport")
+# 1k <1> entersub[t1] KRS*/TARG,STRICT
+# 1l <1> leavesub[1 ref] K/REFC,1
EONT_EONT