xref: /openbsd-src/gnu/usr.bin/perl/ext/B/t/optree_specials.t (revision e068048151d29f2562a32185e21a8ba885482260)
1#!./perl
2
3# This tests the B:: module(s) with CHECK, BEGIN, END and INIT blocks. The
4# text excerpts below marked with "# " in front are the expected output. They
5# are there twice, EOT for threading, and EONT for a non-threading Perl. The
6# output is matched losely. If the match fails even though the "got" and
7# "expected" output look exactly the same, then watch for trailing, invisible
8# spaces.
9#
10# Note that if this test is mysteriously failing smokes and is hard to
11# reproduce, try running with LC_ALL=en_US.UTF-8 PERL_UNICODE="".
12# This causes nextstate ops to have a bunch of extra hint info, which
13# needs adding to the expected output (for both thraded and non-threaded
14# versions)
15
16BEGIN {
17    unshift @INC, 't';
18    require Config;
19    if (($Config::Config{'extensions'} !~ /\bB\b/) ){
20        print "1..0 # Skip -- Perl configured without B module\n";
21        exit 0;
22    }
23}
24
25# import checkOptree(), and %gOpts (containing test state)
26use OptreeCheck;	# ALSO DOES @ARGV HANDLING !!!!!!
27
28plan tests => 15;
29
30require_ok("B::Concise");
31
32my $out = runperl(
33    switches => ["-MO=Concise,BEGIN,CHECK,INIT,END,-exec"],
34    prog => q{$a=$b && print q/foo/},
35    stderr => 1 );
36
37#print "out:$out\n";
38
39my $src = q[our ($beg, $chk, $init, $end, $uc) = qq{'foo'}; BEGIN { $beg++ } CHECK { $chk++ } INIT { $init++ } END { $end++ } UNITCHECK {$uc++}];
40
41
42checkOptree ( name	=> 'BEGIN',
43	      bcopts	=> 'BEGIN',
44	      prog	=> $src,
45	      strip_open_hints => 1,
46	      expect	=> <<'EOT_EOT', expect_nt => <<'EONT_EONT');
47# BEGIN 1:
48# a  <1> leavesub[1 ref] K/REFC,1 ->(end)
49# -     <@> lineseq KP ->a
50# 1        <;> nextstate(Exporter::Heavy -1410 Heavy.pm:4) v:*,&,{,x*,x&,x$,$ ->2
51# 3        <1> require sK/1 ->4
52# 2           <$> const[PV "strict.pm"] s/BARE ->3
53# -        <;> ex-nextstate(Exporter::Heavy -1410 Heavy.pm:4) v:*,&,{,x*,x&,x$,$ ->4
54# -        <@> lineseq K ->-
55# 4           <;> nextstate(Exporter::Heavy -1410 Heavy.pm:4) :*,&,{,x*,x&,x$,$ ->5
56# 9           <1> entersub[t1] KRS/TARG,STRICT ->a
57# 5              <0> pushmark s ->6
58# 6              <$> const[PV "strict"] sM ->7
59# 7              <$> const[PV "refs"] sM ->8
60# 8              <.> method_named[PV "unimport"] ->9
61# BEGIN 2:
62# k  <1> leavesub[1 ref] K/REFC,1 ->(end)
63# -     <@> lineseq KP ->k
64# b        <;> nextstate(Exporter::Heavy -1251 Heavy.pm:202) v:*,&,{,x*,x&,x$ ->c
65# d        <1> require sK/1 ->e
66# c           <$> const[PV "warnings.pm"] s/BARE ->d
67# -        <;> ex-nextstate(Exporter::Heavy -1251 Heavy.pm:202) v:*,&,{,x*,x&,x$ ->e
68# -        <@> lineseq K ->-
69# e           <;> nextstate(Exporter::Heavy -1251 Heavy.pm:202) :*,&,{,x*,x&,x$ ->f
70# j           <1> entersub[t1] KRS/TARG ->k
71# f              <0> pushmark s ->g
72# g              <$> const[PV "warnings"] sM ->h
73# h              <$> const[PV "once"] sM ->i
74# i              <.> method_named[PV "unimport"] ->j
75# BEGIN 3:
76# r  <1> leavesub[1 ref] K/REFC,1 ->(end)
77# -     <@> lineseq KP ->r
78# l        <;> nextstate(B::Concise -1175 Concise.pm:117) v:*,&,{,x*,x&,x$,$ ->m
79# q        <2> sassign sKS/2 ->r
80# o           <1> srefgen sK/1 ->p
81# -              <1> ex-list lKRM ->o
82# n                 <1> rv2gv sKRM/STRICT,1 ->o
83# m                    <#> gv[*STDOUT] s ->n
84# -           <1> ex-rv2sv sKRM*/STRICT,1 ->q
85# p              <#> gvsv[*B::Concise::walkHandle] s ->q
86# BEGIN 4:
87# 11 <1> leavesub[1 ref] K/REFC,1 ->(end)
88# -     <@> lineseq K ->11
89# s        <;> nextstate(B::Concise -1134 Concise.pm:183) v:*,&,x*,x&,x$,$ ->t
90# u        <1> require sK/1 ->v
91# t           <$> const[PV "strict.pm"] s/BARE ->u
92# -        <;> ex-nextstate(B::Concise -1134 Concise.pm:183) v:*,&,x*,x&,x$,$ ->v
93# -        <@> lineseq K ->-
94# v           <;> nextstate(B::Concise -1134 Concise.pm:183) :*,&,x*,x&,x$,$ ->w
95# 10          <1> entersub[t1] KRS/TARG,STRICT ->11
96# w              <0> pushmark s ->x
97# x              <$> const[PV "strict"] sM ->y
98# y              <$> const[PV "refs"] sM ->z
99# z              <.> method_named[PV "unimport"] ->10
100# BEGIN 5:
101# 1b <1> leavesub[1 ref] K/REFC,1 ->(end)
102# -     <@> lineseq K ->1b
103# 12       <;> nextstate(B::Concise -1031 Concise.pm:305) v:*,&,x*,x&,x$,$ ->13
104# 14       <1> require sK/1 ->15
105# 13          <$> const[PV "strict.pm"] s/BARE ->14
106# -        <;> ex-nextstate(B::Concise -1031 Concise.pm:305) v:*,&,x*,x&,x$,$ ->15
107# -        <@> lineseq K ->-
108# 15          <;> nextstate(B::Concise -1031 Concise.pm:305) :*,&,x*,x&,x$,$ ->16
109# 1a          <1> entersub[t1] KRS/TARG,STRICT ->1b
110# 16             <0> pushmark s ->17
111# 17             <$> const[PV "strict"] sM ->18
112# 18             <$> const[PV "refs"] sM ->19
113# 19             <.> method_named[PV "unimport"] ->1a
114# BEGIN 6:
115# 1l <1> leavesub[1 ref] K/REFC,1 ->(end)
116# -     <@> lineseq KP ->1l
117# 1c       <;> nextstate(B::Concise -984 Concise.pm:370) v:*,&,{,x*,x&,x$,$ ->1d
118# 1e       <1> require sK/1 ->1f
119# 1d          <$> const[PV "strict.pm"] s/BARE ->1e
120# -        <;> ex-nextstate(B::Concise -984 Concise.pm:370) v:*,&,{,x*,x&,x$,$ ->1f
121# -        <@> lineseq K ->-
122# 1f          <;> nextstate(B::Concise -984 Concise.pm:370) :*,&,{,x*,x&,x$,$ ->1g
123# 1k          <1> entersub[t1] KRS/TARG,STRICT ->1l
124# 1g             <0> pushmark s ->1h
125# 1h             <$> const[PV "strict"] sM ->1i
126# 1i             <$> const[PV "refs"] sM ->1j
127# 1j             <.> method_named[PV "unimport"] ->1k
128# BEGIN 7:
129# 1v <1> leavesub[1 ref] K/REFC,1 ->(end)
130# -     <@> lineseq K ->1v
131# 1m       <;> nextstate(B::Concise -959 Concise.pm:390) v:*,&,x*,x&,x$,$ ->1n
132# 1o       <1> require sK/1 ->1p
133# 1n          <$> const[PV "strict.pm"] s/BARE ->1o
134# -        <;> ex-nextstate(B::Concise -959 Concise.pm:390) v:*,&,x*,x&,x$,$ ->1p
135# -        <@> lineseq K ->-
136# 1p          <;> nextstate(B::Concise -959 Concise.pm:390) :*,&,x*,x&,x$,$ ->1q
137# 1u          <1> entersub[t1] KRS/TARG,STRICT ->1v
138# 1q             <0> pushmark s ->1r
139# 1r             <$> const[PV "strict"] sM ->1s
140# 1s             <$> const[PV "refs"] sM ->1t
141# 1t             <.> method_named[PV "unimport"] ->1u
142# BEGIN 8:
143# 25 <1> leavesub[1 ref] K/REFC,1 ->(end)
144# -     <@> lineseq KP ->25
145# 1w       <;> nextstate(B::Concise -945 Concise.pm:410) v:*,&,{,x*,x&,x$,$ ->1x
146# 1y       <1> require sK/1 ->1z
147# 1x          <$> const[PV "warnings.pm"] s/BARE ->1y
148# -        <;> ex-nextstate(B::Concise -945 Concise.pm:410) v:*,&,{,x*,x&,x$,$ ->1z
149# -        <@> lineseq K ->-
150# 1z          <;> nextstate(B::Concise -945 Concise.pm:410) :*,&,{,x*,x&,x$,$ ->20
151# 24          <1> entersub[t1] KRS/TARG,STRICT ->25
152# 20             <0> pushmark s ->21
153# 21             <$> const[PV "warnings"] sM ->22
154# 22             <$> const[PV "qw"] sM ->23
155# 23             <.> method_named[PV "unimport"] ->24
156# BEGIN 9:
157# 29 <1> leavesub[1 ref] K/REFC,1 ->(end)
158# -     <@> lineseq KP ->29
159# 26       <;> nextstate(main 3 -e:1) v:{ ->27
160# 28       <1> postinc[t3] sK/1 ->29
161# -           <1> ex-rv2sv sKRM/1 ->28
162# 27             <#> gvsv[*beg] s ->28
163EOT_EOT
164# BEGIN 1:
165# a  <1> leavesub[1 ref] K/REFC,1 ->(end)
166# -     <@> lineseq KP ->a
167# 1        <;> nextstate(Exporter::Heavy -1410 Heavy.pm:4) v:*,&,{,x*,x&,x$,$ ->2
168# 3        <1> require sK/1 ->4
169# 2           <$> const(PV "strict.pm") s/BARE ->3
170# -        <;> ex-nextstate(Exporter::Heavy -1410 Heavy.pm:4) v:*,&,{,x*,x&,x$,$ ->4
171# -        <@> lineseq K ->-
172# 4           <;> nextstate(Exporter::Heavy -1410 Heavy.pm:4) :*,&,{,x*,x&,x$,$ ->5
173# 9           <1> entersub[t1] KRS/TARG,STRICT ->a
174# 5              <0> pushmark s ->6
175# 6              <$> const(PV "strict") sM ->7
176# 7              <$> const(PV "refs") sM ->8
177# 8              <.> method_named(PV "unimport") ->9
178# BEGIN 2:
179# k  <1> leavesub[1 ref] K/REFC,1 ->(end)
180# -     <@> lineseq KP ->k
181# b        <;> nextstate(Exporter::Heavy -1251 Heavy.pm:202) v:*,&,{,x*,x&,x$ ->c
182# d        <1> require sK/1 ->e
183# c           <$> const(PV "warnings.pm") s/BARE ->d
184# -        <;> ex-nextstate(Exporter::Heavy -1251 Heavy.pm:202) v:*,&,{,x*,x&,x$ ->e
185# -        <@> lineseq K ->-
186# e           <;> nextstate(Exporter::Heavy -1251 Heavy.pm:202) :*,&,{,x*,x&,x$ ->f
187# j           <1> entersub[t1] KRS/TARG ->k
188# f              <0> pushmark s ->g
189# g              <$> const(PV "warnings") sM ->h
190# h              <$> const(PV "once") sM ->i
191# i              <.> method_named(PV "unimport") ->j
192# BEGIN 3:
193# r  <1> leavesub[1 ref] K/REFC,1 ->(end)
194# -     <@> lineseq KP ->r
195# l        <;> nextstate(B::Concise -1175 Concise.pm:117) v:*,&,{,x*,x&,x$,$ ->m
196# q        <2> sassign sKS/2 ->r
197# o           <1> srefgen sK/1 ->p
198# -              <1> ex-list lKRM ->o
199# n                 <1> rv2gv sKRM/STRICT,1 ->o
200# m                    <$> gv(*STDOUT) s ->n
201# -           <1> ex-rv2sv sKRM*/STRICT,1 ->q
202# p              <$> gvsv(*B::Concise::walkHandle) s ->q
203# BEGIN 4:
204# 11 <1> leavesub[1 ref] K/REFC,1 ->(end)
205# -     <@> lineseq K ->11
206# s        <;> nextstate(B::Concise -1134 Concise.pm:183) v:*,&,x*,x&,x$,$ ->t
207# u        <1> require sK/1 ->v
208# t           <$> const(PV "strict.pm") s/BARE ->u
209# -        <;> ex-nextstate(B::Concise -1134 Concise.pm:183) v:*,&,x*,x&,x$,$ ->v
210# -        <@> lineseq K ->-
211# v           <;> nextstate(B::Concise -1134 Concise.pm:183) :*,&,x*,x&,x$,$ ->w
212# 10          <1> entersub[t1] KRS/TARG,STRICT ->11
213# w              <0> pushmark s ->x
214# x              <$> const(PV "strict") sM ->y
215# y              <$> const(PV "refs") sM ->z
216# z              <.> method_named(PV "unimport") ->10
217# BEGIN 5:
218# 1b <1> leavesub[1 ref] K/REFC,1 ->(end)
219# -     <@> lineseq K ->1b
220# 12       <;> nextstate(B::Concise -1031 Concise.pm:305) v:*,&,x*,x&,x$,$ ->13
221# 14       <1> require sK/1 ->15
222# 13          <$> const(PV "strict.pm") s/BARE ->14
223# -        <;> ex-nextstate(B::Concise -1031 Concise.pm:305) v:*,&,x*,x&,x$,$ ->15
224# -        <@> lineseq K ->-
225# 15          <;> nextstate(B::Concise -1031 Concise.pm:305) :*,&,x*,x&,x$,$ ->16
226# 1a          <1> entersub[t1] KRS/TARG,STRICT ->1b
227# 16             <0> pushmark s ->17
228# 17             <$> const(PV "strict") sM ->18
229# 18             <$> const(PV "refs") sM ->19
230# 19             <.> method_named(PV "unimport") ->1a
231# BEGIN 6:
232# 1l <1> leavesub[1 ref] K/REFC,1 ->(end)
233# -     <@> lineseq KP ->1l
234# 1c       <;> nextstate(B::Concise -984 Concise.pm:370) v:*,&,{,x*,x&,x$,$ ->1d
235# 1e       <1> require sK/1 ->1f
236# 1d          <$> const(PV "strict.pm") s/BARE ->1e
237# -        <;> ex-nextstate(B::Concise -984 Concise.pm:370) v:*,&,{,x*,x&,x$,$ ->1f
238# -        <@> lineseq K ->-
239# 1f          <;> nextstate(B::Concise -984 Concise.pm:370) :*,&,{,x*,x&,x$,$ ->1g
240# 1k          <1> entersub[t1] KRS/TARG,STRICT ->1l
241# 1g             <0> pushmark s ->1h
242# 1h             <$> const(PV "strict") sM ->1i
243# 1i             <$> const(PV "refs") sM ->1j
244# 1j             <.> method_named(PV "unimport") ->1k
245# BEGIN 7:
246# 1v <1> leavesub[1 ref] K/REFC,1 ->(end)
247# -     <@> lineseq K ->1v
248# 1m       <;> nextstate(B::Concise -959 Concise.pm:390) v:*,&,x*,x&,x$,$ ->1n
249# 1o       <1> require sK/1 ->1p
250# 1n          <$> const(PV "strict.pm") s/BARE ->1o
251# -        <;> ex-nextstate(B::Concise -959 Concise.pm:390) v:*,&,x*,x&,x$,$ ->1p
252# -        <@> lineseq K ->-
253# 1p          <;> nextstate(B::Concise -959 Concise.pm:390) :*,&,x*,x&,x$,$ ->1q
254# 1u          <1> entersub[t1] KRS/TARG,STRICT ->1v
255# 1q             <0> pushmark s ->1r
256# 1r             <$> const(PV "strict") sM ->1s
257# 1s             <$> const(PV "refs") sM ->1t
258# 1t             <.> method_named(PV "unimport") ->1u
259# BEGIN 8:
260# 25 <1> leavesub[1 ref] K/REFC,1 ->(end)
261# -     <@> lineseq KP ->25
262# 1w       <;> nextstate(B::Concise -945 Concise.pm:410) v:*,&,{,x*,x&,x$,$ ->1x
263# 1y       <1> require sK/1 ->1z
264# 1x          <$> const(PV "warnings.pm") s/BARE ->1y
265# -        <;> ex-nextstate(B::Concise -945 Concise.pm:410) v:*,&,{,x*,x&,x$,$ ->1z
266# -        <@> lineseq K ->-
267# 1z          <;> nextstate(B::Concise -945 Concise.pm:410) :*,&,{,x*,x&,x$,$ ->20
268# 24          <1> entersub[t1] KRS/TARG,STRICT ->25
269# 20             <0> pushmark s ->21
270# 21             <$> const(PV "warnings") sM ->22
271# 22             <$> const(PV "qw") sM ->23
272# 23             <.> method_named(PV "unimport") ->24
273# BEGIN 9:
274# 29 <1> leavesub[1 ref] K/REFC,1 ->(end)
275# -     <@> lineseq KP ->29
276# 26       <;> nextstate(main 3 -e:1) v:{ ->27
277# 28       <1> postinc[t2] sK/1 ->29
278# -           <1> ex-rv2sv sKRM/1 ->28
279# 27             <$> gvsv(*beg) s ->28
280EONT_EONT
281
282checkOptree ( name	=> 'END',
283	      bcopts	=> 'END',
284	      prog	=> $src,
285	      strip_open_hints => 1,
286	      expect	=> <<'EOT_EOT', expect_nt => <<'EONT_EONT');
287# END 1:
288# 4  <1> leavesub[1 ref] K/REFC,1 ->(end)
289# -     <@> lineseq KP ->4
290# 1        <;> nextstate(main 5 -e:6) v:>,<,%,{ ->2
291# 3        <1> postinc[t3] sK/1 ->4
292# -           <1> ex-rv2sv sKRM/1 ->3
293# 2              <#> gvsv[*end] s ->3
294EOT_EOT
295# END 1:
296# 4  <1> leavesub[1 ref] K/REFC,1 ->(end)
297# -     <@> lineseq KP ->4
298# 1        <;> nextstate(main 5 -e:6) v:>,<,%,{ ->2
299# 3        <1> postinc[t2] sK/1 ->4
300# -           <1> ex-rv2sv sKRM/1 ->3
301# 2              <$> gvsv(*end) s ->3
302EONT_EONT
303
304checkOptree ( name	=> 'CHECK',
305	      bcopts	=> 'CHECK',
306	      prog	=> $src,
307	      strip_open_hints => 1,
308	      expect	=> <<'EOT_EOT', expect_nt => <<'EONT_EONT');
309# CHECK 1:
310# 4  <1> leavesub[1 ref] K/REFC,1 ->(end)
311# -     <@> lineseq KP ->4
312# 1        <;> nextstate(main 3 -e:4) v:>,<,%,{ ->2
313# 3        <1> postinc[t3] sK/1 ->4
314# -           <1> ex-rv2sv sKRM/1 ->3
315# 2              <#> gvsv[*chk] s ->3
316EOT_EOT
317# CHECK 1:
318# 4  <1> leavesub[1 ref] K/REFC,1 ->(end)
319# -     <@> lineseq KP ->4
320# 1        <;> nextstate(main 3 -e:4) v:>,<,%,{ ->2
321# 3        <1> postinc[t2] sK/1 ->4
322# -           <1> ex-rv2sv sKRM/1 ->3
323# 2              <$> gvsv(*chk) s ->3
324EONT_EONT
325
326checkOptree ( name	=> 'UNITCHECK',
327	      bcopts=> 'UNITCHECK',
328	      prog	=> $src,
329	      strip_open_hints => 1,
330	      expect=> <<'EOT_EOT', expect_nt => <<'EONT_EONT');
331# UNITCHECK 1:
332# 4  <1> leavesub[1 ref] K/REFC,1 ->(end)
333# -     <@> lineseq KP ->4
334# 1        <;> nextstate(main 3 -e:4) v:>,<,%,{ ->2
335# 3        <1> postinc[t3] sK/1 ->4
336# -           <1> ex-rv2sv sKRM/1 ->3
337# 2              <#> gvsv[*uc] s ->3
338EOT_EOT
339# UNITCHECK 1:
340# 4  <1> leavesub[1 ref] K/REFC,1 ->(end)
341# -     <@> lineseq KP ->4
342# 1        <;> nextstate(main 3 -e:4) v:>,<,%,{ ->2
343# 3        <1> postinc[t2] sK/1 ->4
344# -           <1> ex-rv2sv sKRM/1 ->3
345# 2              <$> gvsv(*uc) s ->3
346EONT_EONT
347
348checkOptree ( name	=> 'INIT',
349	      bcopts	=> 'INIT',
350	      #todo	=> 'get working',
351	      prog	=> $src,
352	      strip_open_hints => 1,
353	      expect	=> <<'EOT_EOT', expect_nt => <<'EONT_EONT');
354# INIT 1:
355# 4  <1> leavesub[1 ref] K/REFC,1 ->(end)
356# -     <@> lineseq KP ->4
357# 1        <;> nextstate(main 4 -e:5) v:>,<,%,{ ->2
358# 3        <1> postinc[t3] sK/1 ->4
359# -           <1> ex-rv2sv sKRM/1 ->3
360# 2              <#> gvsv[*init] s ->3
361EOT_EOT
362# INIT 1:
363# 4  <1> leavesub[1 ref] K/REFC,1 ->(end)
364# -     <@> lineseq KP ->4
365# 1        <;> nextstate(main 4 -e:5) v:>,<,%,{ ->2
366# 3        <1> postinc[t2] sK/1 ->4
367# -           <1> ex-rv2sv sKRM/1 ->3
368# 2              <$> gvsv(*init) s ->3
369EONT_EONT
370
371checkOptree ( name	=> 'all of BEGIN END INIT CHECK UNITCHECK -exec',
372	      bcopts	=> [qw/ BEGIN END INIT CHECK UNITCHECK -exec /],
373	      prog	=> $src,
374	      strip_open_hints => 1,
375	      expect	=> <<'EOT_EOT', expect_nt => <<'EONT_EONT');
376# BEGIN 1:
377# 1  <;> nextstate(Exporter::Heavy -1410 Heavy.pm:4) v:*,&,{,x*,x&,x$,$
378# 2  <$> const[PV "strict.pm"] s/BARE
379# 3  <1> require sK/1
380# 4  <;> nextstate(Exporter::Heavy -1410 Heavy.pm:4) :*,&,{,x*,x&,x$,$
381# 5  <0> pushmark s
382# 6  <$> const[PV "strict"] sM
383# 7  <$> const[PV "refs"] sM
384# 8  <.> method_named[PV "unimport"]
385# 9  <1> entersub[t1] KRS/TARG,STRICT
386# a  <1> leavesub[1 ref] K/REFC,1
387# BEGIN 2:
388# b  <;> nextstate(Exporter::Heavy -1251 Heavy.pm:202) v:*,&,{,x*,x&,x$
389# c  <$> const[PV "warnings.pm"] s/BARE
390# d  <1> require sK/1
391# e  <;> nextstate(Exporter::Heavy -1251 Heavy.pm:202) :*,&,{,x*,x&,x$
392# f  <0> pushmark s
393# g  <$> const[PV "warnings"] sM
394# h  <$> const[PV "once"] sM
395# i  <.> method_named[PV "unimport"]
396# j  <1> entersub[t1] KRS/TARG
397# k  <1> leavesub[1 ref] K/REFC,1
398# BEGIN 3:
399# l  <;> nextstate(B::Concise -1175 Concise.pm:117) v:*,&,{,x*,x&,x$,$
400# m  <#> gv[*STDOUT] s
401# n  <1> rv2gv sKRM/STRICT,1
402# o  <1> srefgen sK/1
403# p  <#> gvsv[*B::Concise::walkHandle] s
404# q  <2> sassign sKS/2
405# r  <1> leavesub[1 ref] K/REFC,1
406# BEGIN 4:
407# s  <;> nextstate(B::Concise -1134 Concise.pm:183) v:*,&,x*,x&,x$,$
408# t  <$> const[PV "strict.pm"] s/BARE
409# u  <1> require sK/1
410# v  <;> nextstate(B::Concise -1134 Concise.pm:183) :*,&,x*,x&,x$,$
411# w  <0> pushmark s
412# x  <$> const[PV "strict"] sM
413# y  <$> const[PV "refs"] sM
414# z  <.> method_named[PV "unimport"]
415# 10 <1> entersub[t1] KRS/TARG,STRICT
416# 11 <1> leavesub[1 ref] K/REFC,1
417# BEGIN 5:
418# 12 <;> nextstate(B::Concise -1031 Concise.pm:305) v:*,&,x*,x&,x$,$
419# 13 <$> const[PV "strict.pm"] s/BARE
420# 14 <1> require sK/1
421# 15 <;> nextstate(B::Concise -1031 Concise.pm:305) :*,&,x*,x&,x$,$
422# 16 <0> pushmark s
423# 17 <$> const[PV "strict"] sM
424# 18 <$> const[PV "refs"] sM
425# 19 <.> method_named[PV "unimport"]
426# 1a <1> entersub[t1] KRS/TARG,STRICT
427# 1b <1> leavesub[1 ref] K/REFC,1
428# BEGIN 6:
429# 1c <;> nextstate(B::Concise -984 Concise.pm:370) v:*,&,{,x*,x&,x$,$
430# 1d <$> const[PV "strict.pm"] s/BARE
431# 1e <1> require sK/1
432# 1f <;> nextstate(B::Concise -984 Concise.pm:370) :*,&,{,x*,x&,x$,$
433# 1g <0> pushmark s
434# 1h <$> const[PV "strict"] sM
435# 1i <$> const[PV "refs"] sM
436# 1j <.> method_named[PV "unimport"]
437# 1k <1> entersub[t1] KRS/TARG,STRICT
438# 1l <1> leavesub[1 ref] K/REFC,1
439# BEGIN 7:
440# 1m <;> nextstate(B::Concise -959 Concise.pm:390) v:*,&,x*,x&,x$,$
441# 1n <$> const[PV "strict.pm"] s/BARE
442# 1o <1> require sK/1
443# 1p <;> nextstate(B::Concise -959 Concise.pm:390) :*,&,x*,x&,x$,$
444# 1q <0> pushmark s
445# 1r <$> const[PV "strict"] sM
446# 1s <$> const[PV "refs"] sM
447# 1t <.> method_named[PV "unimport"]
448# 1u <1> entersub[t1] KRS/TARG,STRICT
449# 1v <1> leavesub[1 ref] K/REFC,1
450# BEGIN 8:
451# 1w <;> nextstate(B::Concise -945 Concise.pm:410) v:*,&,{,x*,x&,x$,$
452# 1x <$> const[PV "warnings.pm"] s/BARE
453# 1y <1> require sK/1
454# 1z <;> nextstate(B::Concise -945 Concise.pm:410) :*,&,{,x*,x&,x$,$
455# 20 <0> pushmark s
456# 21 <$> const[PV "warnings"] sM
457# 22 <$> const[PV "qw"] sM
458# 23 <.> method_named[PV "unimport"]
459# 24 <1> entersub[t1] KRS/TARG,STRICT
460# 25 <1> leavesub[1 ref] K/REFC,1
461# BEGIN 9:
462# 26 <;> nextstate(main 3 -e:1) v:{
463# 27 <#> gvsv[*beg] s
464# 28 <1> postinc[t3] sK/1
465# 29 <1> leavesub[1 ref] K/REFC,1
466# END 1:
467# 2a <;> nextstate(main 9 -e:1) v:{
468# 2b <#> gvsv[*end] s
469# 2c <1> postinc[t3] sK/1
470# 2d <1> leavesub[1 ref] K/REFC,1
471# INIT 1:
472# 2e <;> nextstate(main 7 -e:1) v:{
473# 2f <#> gvsv[*init] s
474# 2g <1> postinc[t3] sK/1
475# 2h <1> leavesub[1 ref] K/REFC,1
476# CHECK 1:
477# 2i <;> nextstate(main 5 -e:1) v:{
478# 2j <#> gvsv[*chk] s
479# 2k <1> postinc[t3] sK/1
480# 2l <1> leavesub[1 ref] K/REFC,1
481# UNITCHECK 1:
482# 2m <;> nextstate(main 11 -e:1) v:{
483# 2n <#> gvsv[*uc] s
484# 2o <1> postinc[t3] sK/1
485# 2p <1> leavesub[1 ref] K/REFC,1
486EOT_EOT
487# BEGIN 1:
488# 1  <;> nextstate(Exporter::Heavy -1410 Heavy.pm:4) v:*,&,{,x*,x&,x$,$
489# 2  <$> const(PV "strict.pm") s/BARE
490# 3  <1> require sK/1
491# 4  <;> nextstate(Exporter::Heavy -1410 Heavy.pm:4) :*,&,{,x*,x&,x$,$
492# 5  <0> pushmark s
493# 6  <$> const(PV "strict") sM
494# 7  <$> const(PV "refs") sM
495# 8  <.> method_named(PV "unimport")
496# 9  <1> entersub[t1] KRS/TARG,STRICT
497# a  <1> leavesub[1 ref] K/REFC,1
498# BEGIN 2:
499# b  <;> nextstate(Exporter::Heavy -1251 Heavy.pm:202) v:*,&,{,x*,x&,x$
500# c  <$> const(PV "warnings.pm") s/BARE
501# d  <1> require sK/1
502# e  <;> nextstate(Exporter::Heavy -1251 Heavy.pm:202) :*,&,{,x*,x&,x$
503# f  <0> pushmark s
504# g  <$> const(PV "warnings") sM
505# h  <$> const(PV "once") sM
506# i  <.> method_named(PV "unimport")
507# j  <1> entersub[t1] KRS/TARG
508# k  <1> leavesub[1 ref] K/REFC,1
509# BEGIN 3:
510# l  <;> nextstate(B::Concise -1175 Concise.pm:117) v:*,&,{,x*,x&,x$,$
511# m  <$> gv(*STDOUT) s
512# n  <1> rv2gv sKRM/STRICT,1
513# o  <1> srefgen sK/1
514# p  <$> gvsv(*B::Concise::walkHandle) s
515# q  <2> sassign sKS/2
516# r  <1> leavesub[1 ref] K/REFC,1
517# BEGIN 4:
518# s  <;> nextstate(B::Concise -1134 Concise.pm:183) v:*,&,x*,x&,x$,$
519# t  <$> const(PV "strict.pm") s/BARE
520# u  <1> require sK/1
521# v  <;> nextstate(B::Concise -1134 Concise.pm:183) :*,&,x*,x&,x$,$
522# w  <0> pushmark s
523# x  <$> const(PV "strict") sM
524# y  <$> const(PV "refs") sM
525# z  <.> method_named(PV "unimport")
526# 10 <1> entersub[t1] KRS/TARG,STRICT
527# 11 <1> leavesub[1 ref] K/REFC,1
528# BEGIN 5:
529# 12 <;> nextstate(B::Concise -1031 Concise.pm:305) v:*,&,x*,x&,x$,$
530# 13 <$> const(PV "strict.pm") s/BARE
531# 14 <1> require sK/1
532# 15 <;> nextstate(B::Concise -1031 Concise.pm:305) :*,&,x*,x&,x$,$
533# 16 <0> pushmark s
534# 17 <$> const(PV "strict") sM
535# 18 <$> const(PV "refs") sM
536# 19 <.> method_named(PV "unimport")
537# 1a <1> entersub[t1] KRS/TARG,STRICT
538# 1b <1> leavesub[1 ref] K/REFC,1
539# BEGIN 6:
540# 1c <;> nextstate(B::Concise -984 Concise.pm:370) v:*,&,{,x*,x&,x$,$
541# 1d <$> const(PV "strict.pm") s/BARE
542# 1e <1> require sK/1
543# 1f <;> nextstate(B::Concise -984 Concise.pm:370) :*,&,{,x*,x&,x$,$
544# 1g <0> pushmark s
545# 1h <$> const(PV "strict") sM
546# 1i <$> const(PV "refs") sM
547# 1j <.> method_named(PV "unimport")
548# 1k <1> entersub[t1] KRS/TARG,STRICT
549# 1l <1> leavesub[1 ref] K/REFC,1
550# BEGIN 7:
551# 1m <;> nextstate(B::Concise -959 Concise.pm:390) v:*,&,x*,x&,x$,$
552# 1n <$> const(PV "strict.pm") s/BARE
553# 1o <1> require sK/1
554# 1p <;> nextstate(B::Concise -959 Concise.pm:390) :*,&,x*,x&,x$,$
555# 1q <0> pushmark s
556# 1r <$> const(PV "strict") sM
557# 1s <$> const(PV "refs") sM
558# 1t <.> method_named(PV "unimport")
559# 1u <1> entersub[t1] KRS/TARG,STRICT
560# 1v <1> leavesub[1 ref] K/REFC,1
561# BEGIN 8:
562# 1w <;> nextstate(B::Concise -945 Concise.pm:410) v:*,&,{,x*,x&,x$,$
563# 1x <$> const(PV "warnings.pm") s/BARE
564# 1y <1> require sK/1
565# 1z <;> nextstate(B::Concise -945 Concise.pm:410) :*,&,{,x*,x&,x$,$
566# 20 <0> pushmark s
567# 21 <$> const(PV "warnings") sM
568# 22 <$> const(PV "qw") sM
569# 23 <.> method_named(PV "unimport")
570# 24 <1> entersub[t1] KRS/TARG,STRICT
571# 25 <1> leavesub[1 ref] K/REFC,1
572# BEGIN 9:
573# 26 <;> nextstate(main 3 -e:1) v:{
574# 27 <$> gvsv(*beg) s
575# 28 <1> postinc[t2] sK/1
576# 29 <1> leavesub[1 ref] K/REFC,1
577# END 1:
578# 2a <;> nextstate(main 9 -e:1) v:{
579# 2b <$> gvsv(*end) s
580# 2c <1> postinc[t2] sK/1
581# 2d <1> leavesub[1 ref] K/REFC,1
582# INIT 1:
583# 2e <;> nextstate(main 7 -e:1) v:{
584# 2f <$> gvsv(*init) s
585# 2g <1> postinc[t2] sK/1
586# 2h <1> leavesub[1 ref] K/REFC,1
587# CHECK 1:
588# 2i <;> nextstate(main 5 -e:1) v:{
589# 2j <$> gvsv(*chk) s
590# 2k <1> postinc[t2] sK/1
591# 2l <1> leavesub[1 ref] K/REFC,1
592# UNITCHECK 1:
593# 2m <;> nextstate(main 11 -e:1) v:{
594# 2n <$> gvsv(*uc) s
595# 2o <1> postinc[t2] sK/1
596# 2p <1> leavesub[1 ref] K/REFC,1
597EONT_EONT
598
599# perl "-I../lib" -MO=Concise,BEGIN,CHECK,INIT,END,-exec -e '$a=$b && print q/foo/'
600
601checkOptree ( name	=> 'regression test for patch 25352',
602	      bcopts	=> [qw/ BEGIN END INIT CHECK -exec /],
603	      prog	=> 'print q/foo/',
604	      expect	=> <<'EOT_EOT', expect_nt => <<'EONT_EONT');
605# BEGIN 1:
606# 1  <;> nextstate(Exporter::Heavy -1410 Heavy.pm:4) v:*,&,{,x*,x&,x$,$
607# 2  <$> const[PV "strict.pm"] s/BARE
608# 3  <1> require sK/1
609# 4  <;> nextstate(Exporter::Heavy -1410 Heavy.pm:4) :*,&,{,x*,x&,x$,$
610# 5  <0> pushmark s
611# 6  <$> const[PV "strict"] sM
612# 7  <$> const[PV "refs"] sM
613# 8  <.> method_named[PV "unimport"]
614# 9  <1> entersub[t1] KRS/TARG,STRICT
615# a  <1> leavesub[1 ref] K/REFC,1
616# BEGIN 2:
617# b  <;> nextstate(Exporter::Heavy -1251 Heavy.pm:202) v:*,&,{,x*,x&,x$
618# c  <$> const[PV "warnings.pm"] s/BARE
619# d  <1> require sK/1
620# e  <;> nextstate(Exporter::Heavy -1251 Heavy.pm:202) :*,&,{,x*,x&,x$
621# f  <0> pushmark s
622# g  <$> const[PV "warnings"] sM
623# h  <$> const[PV "once"] sM
624# i  <.> method_named[PV "unimport"]
625# j  <1> entersub[t1] KRS/TARG
626# k  <1> leavesub[1 ref] K/REFC,1
627# BEGIN 3:
628# l  <;> nextstate(B::Concise -1175 Concise.pm:117) v:*,&,{,x*,x&,x$,$
629# m  <#> gv[*STDOUT] s
630# n  <1> rv2gv sKRM/STRICT,1
631# o  <1> srefgen sK/1
632# p  <#> gvsv[*B::Concise::walkHandle] s
633# q  <2> sassign sKS/2
634# r  <1> leavesub[1 ref] K/REFC,1
635# BEGIN 4:
636# s  <;> nextstate(B::Concise -1134 Concise.pm:183) v:*,&,x*,x&,x$,$
637# t  <$> const[PV "strict.pm"] s/BARE
638# u  <1> require sK/1
639# v  <;> nextstate(B::Concise -1134 Concise.pm:183) :*,&,x*,x&,x$,$
640# w  <0> pushmark s
641# x  <$> const[PV "strict"] sM
642# y  <$> const[PV "refs"] sM
643# z  <.> method_named[PV "unimport"]
644# 10 <1> entersub[t1] KRS/TARG,STRICT
645# 11 <1> leavesub[1 ref] K/REFC,1
646# BEGIN 5:
647# 12 <;> nextstate(B::Concise -1031 Concise.pm:305) v:*,&,x*,x&,x$,$
648# 13 <$> const[PV "strict.pm"] s/BARE
649# 14 <1> require sK/1
650# 15 <;> nextstate(B::Concise -1031 Concise.pm:305) :*,&,x*,x&,x$,$
651# 16 <0> pushmark s
652# 17 <$> const[PV "strict"] sM
653# 18 <$> const[PV "refs"] sM
654# 19 <.> method_named[PV "unimport"]
655# 1a <1> entersub[t1] KRS/TARG,STRICT
656# 1b <1> leavesub[1 ref] K/REFC,1
657# BEGIN 6:
658# 1c <;> nextstate(B::Concise -984 Concise.pm:370) v:*,&,{,x*,x&,x$,$
659# 1d <$> const[PV "strict.pm"] s/BARE
660# 1e <1> require sK/1
661# 1f <;> nextstate(B::Concise -984 Concise.pm:370) :*,&,{,x*,x&,x$,$
662# 1g <0> pushmark s
663# 1h <$> const[PV "strict"] sM
664# 1i <$> const[PV "refs"] sM
665# 1j <.> method_named[PV "unimport"]
666# 1k <1> entersub[t1] KRS/TARG,STRICT
667# 1l <1> leavesub[1 ref] K/REFC,1
668# BEGIN 7:
669# 1m <;> nextstate(B::Concise -959 Concise.pm:390) v:*,&,x*,x&,x$,$
670# 1n <$> const[PV "strict.pm"] s/BARE
671# 1o <1> require sK/1
672# 1p <;> nextstate(B::Concise -959 Concise.pm:390) :*,&,x*,x&,x$,$
673# 1q <0> pushmark s
674# 1r <$> const[PV "strict"] sM
675# 1s <$> const[PV "refs"] sM
676# 1t <.> method_named[PV "unimport"]
677# 1u <1> entersub[t1] KRS/TARG,STRICT
678# 1v <1> leavesub[1 ref] K/REFC,1
679# BEGIN 8:
680# 1w <;> nextstate(B::Concise -945 Concise.pm:410) v:*,&,{,x*,x&,x$,$
681# 1x <$> const[PV "warnings.pm"] s/BARE
682# 1y <1> require sK/1
683# 1z <;> nextstate(B::Concise -945 Concise.pm:410) :*,&,{,x*,x&,x$,$
684# 20 <0> pushmark s
685# 21 <$> const[PV "warnings"] sM
686# 22 <$> const[PV "qw"] sM
687# 23 <.> method_named[PV "unimport"]
688# 24 <1> entersub[t1] KRS/TARG,STRICT
689# 25 <1> leavesub[1 ref] K/REFC,1
690EOT_EOT
691# BEGIN 1:
692# 1  <;> nextstate(Exporter::Heavy -1410 Heavy.pm:4) v:*,&,{,x*,x&,x$,$
693# 2  <$> const(PV "strict.pm") s/BARE
694# 3  <1> require sK/1
695# 4  <;> nextstate(Exporter::Heavy -1410 Heavy.pm:4) :*,&,{,x*,x&,x$,$
696# 5  <0> pushmark s
697# 6  <$> const(PV "strict") sM
698# 7  <$> const(PV "refs") sM
699# 8  <.> method_named(PV "unimport")
700# 9  <1> entersub[t1] KRS/TARG,STRICT
701# a  <1> leavesub[1 ref] K/REFC,1
702# BEGIN 2:
703# b  <;> nextstate(Exporter::Heavy -1251 Heavy.pm:202) v:*,&,{,x*,x&,x$
704# c  <$> const(PV "warnings.pm") s/BARE
705# d  <1> require sK/1
706# e  <;> nextstate(Exporter::Heavy -1251 Heavy.pm:202) :*,&,{,x*,x&,x$
707# f  <0> pushmark s
708# g  <$> const(PV "warnings") sM
709# h  <$> const(PV "once") sM
710# i  <.> method_named(PV "unimport")
711# j  <1> entersub[t1] KRS/TARG
712# k  <1> leavesub[1 ref] K/REFC,1
713# BEGIN 3:
714# l  <;> nextstate(B::Concise -1175 Concise.pm:117) v:*,&,{,x*,x&,x$,$
715# m  <$> gv(*STDOUT) s
716# n  <1> rv2gv sKRM/STRICT,1
717# o  <1> srefgen sK/1
718# p  <$> gvsv(*B::Concise::walkHandle) s
719# q  <2> sassign sKS/2
720# r  <1> leavesub[1 ref] K/REFC,1
721# BEGIN 4:
722# s  <;> nextstate(B::Concise -1134 Concise.pm:183) v:*,&,x*,x&,x$,$
723# t  <$> const(PV "strict.pm") s/BARE
724# u  <1> require sK/1
725# v  <;> nextstate(B::Concise -1134 Concise.pm:183) :*,&,x*,x&,x$,$
726# w  <0> pushmark s
727# x  <$> const(PV "strict") sM
728# y  <$> const(PV "refs") sM
729# z  <.> method_named(PV "unimport")
730# 10 <1> entersub[t1] KRS/TARG,STRICT
731# 11 <1> leavesub[1 ref] K/REFC,1
732# BEGIN 5:
733# 12 <;> nextstate(B::Concise -1031 Concise.pm:305) v:*,&,x*,x&,x$,$
734# 13 <$> const(PV "strict.pm") s/BARE
735# 14 <1> require sK/1
736# 15 <;> nextstate(B::Concise -1031 Concise.pm:305) :*,&,x*,x&,x$,$
737# 16 <0> pushmark s
738# 17 <$> const(PV "strict") sM
739# 18 <$> const(PV "refs") sM
740# 19 <.> method_named(PV "unimport")
741# 1a <1> entersub[t1] KRS/TARG,STRICT
742# 1b <1> leavesub[1 ref] K/REFC,1
743# BEGIN 6:
744# 1c <;> nextstate(B::Concise -984 Concise.pm:370) v:*,&,{,x*,x&,x$,$
745# 1d <$> const(PV "strict.pm") s/BARE
746# 1e <1> require sK/1
747# 1f <;> nextstate(B::Concise -984 Concise.pm:370) :*,&,{,x*,x&,x$,$
748# 1g <0> pushmark s
749# 1h <$> const(PV "strict") sM
750# 1i <$> const(PV "refs") sM
751# 1j <.> method_named(PV "unimport")
752# 1k <1> entersub[t1] KRS/TARG,STRICT
753# 1l <1> leavesub[1 ref] K/REFC,1
754# BEGIN 7:
755# 1m <;> nextstate(B::Concise -959 Concise.pm:390) v:*,&,x*,x&,x$,$
756# 1n <$> const(PV "strict.pm") s/BARE
757# 1o <1> require sK/1
758# 1p <;> nextstate(B::Concise -959 Concise.pm:390) :*,&,x*,x&,x$,$
759# 1q <0> pushmark s
760# 1r <$> const(PV "strict") sM
761# 1s <$> const(PV "refs") sM
762# 1t <.> method_named(PV "unimport")
763# 1u <1> entersub[t1] KRS/TARG,STRICT
764# 1v <1> leavesub[1 ref] K/REFC,1
765# BEGIN 8:
766# 1w <;> nextstate(B::Concise -945 Concise.pm:410) v:*,&,{,x*,x&,x$,$
767# 1x <$> const(PV "warnings.pm") s/BARE
768# 1y <1> require sK/1
769# 1z <;> nextstate(B::Concise -945 Concise.pm:410) :*,&,{,x*,x&,x$,$
770# 20 <0> pushmark s
771# 21 <$> const(PV "warnings") sM
772# 22 <$> const(PV "qw") sM
773# 23 <.> method_named(PV "unimport")
774# 24 <1> entersub[t1] KRS/TARG,STRICT
775# 25 <1> leavesub[1 ref] K/REFC,1
776EONT_EONT
777