Commit | Line | Data |
cc02ea56 |
1 | #!./perl |
2 | |
09e96b99 |
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 | |
cc02ea56 |
10 | BEGIN { |
5638aaac |
11 | if ($ENV{PERL_CORE}){ |
12 | chdir('t') if -d 't'; |
13 | @INC = ('.', '../lib', '../ext/B/t'); |
14 | } else { |
15 | unshift @INC, 't'; |
16 | push @INC, "../../t"; |
17 | } |
9cd8f857 |
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 | } |
19e169bf |
23 | # require 'test.pl'; # now done by OptreeCheck |
cc02ea56 |
24 | } |
25 | |
26 | # import checkOptree(), and %gOpts (containing test state) |
27 | use OptreeCheck; # ALSO DOES @ARGV HANDLING !!!!!! |
28 | use Config; |
29 | |
e412117e |
30 | plan tests => 7 + ($] > 5.009 ? 1 : 0); |
cc02ea56 |
31 | |
32 | require_ok("B::Concise"); |
33 | |
34 | my $out = runperl( |
35 | switches => ["-MO=Concise,BEGIN,CHECK,INIT,END,-exec"], |
36 | prog => q{$a=$b && print q/foo/}, |
37 | stderr => 1 ); |
38 | |
39 | #print "out:$out\n"; |
40 | |
676456c2 |
41 | my $src = q[our ($beg, $chk, $init, $end, $uc) = qq{'foo'}; BEGIN { $beg++ } CHECK { $chk++ } INIT { $init++ } END { $end++ } UNITCHECK {$uc++}]; |
cc02ea56 |
42 | |
43 | |
b8443148 |
44 | my @warnings_todo; |
45 | @warnings_todo = (todo => |
46 | "Change 23768 (Remove Carp from warnings.pm) alters expected output, not" |
47 | . "propagated to 5.8.x") |
48 | if $] < 5.009; |
49 | |
cc02ea56 |
50 | checkOptree ( name => 'BEGIN', |
51 | bcopts => 'BEGIN', |
52 | prog => $src, |
b8443148 |
53 | @warnings_todo, |
be2b1c74 |
54 | strip_open_hints => 1, |
cc02ea56 |
55 | expect => <<'EOT_EOT', expect_nt => <<'EONT_EONT'); |
56 | # BEGIN 1: |
57 | # b <1> leavesub[1 ref] K/REFC,1 ->(end) |
58 | # - <@> lineseq KP ->b |
9e0f9750 |
59 | # 1 <;> nextstate(B::Concise -275 Concise.pm:356) v:*,&,{,$ ->2 |
cc02ea56 |
60 | # 3 <1> require sK/1 ->4 |
9e0f9750 |
61 | # 2 <$> const[PV "strict.pm"] s/BARE ->3 |
62 | # 4 <;> nextstate(B::Concise -275 Concise.pm:356) v:*,&,{,$ ->5 |
cc02ea56 |
63 | # - <@> lineseq K ->- |
9e0f9750 |
64 | # 5 <;> nextstate(B::Concise -275 Concise.pm:356) :*,&,{,$ ->6 |
cc02ea56 |
65 | # a <1> entersub[t1] KS*/TARG,2 ->b |
66 | # 6 <0> pushmark s ->7 |
9e0f9750 |
67 | # 7 <$> const[PV "strict"] sM ->8 |
68 | # 8 <$> const[PV "refs"] sM ->9 |
69 | # 9 <$> method_named[PV "unimport"] ->a |
cc02ea56 |
70 | # BEGIN 2: |
9e0f9750 |
71 | # m <1> leavesub[1 ref] K/REFC,1 ->(end) |
72 | # - <@> lineseq K ->m |
73 | # c <;> nextstate(B::Concise -265 Concise.pm:367) v:*,&,$ ->d |
74 | # e <1> require sK/1 ->f |
75 | # d <$> const[PV "strict.pm"] s/BARE ->e |
76 | # f <;> nextstate(B::Concise -265 Concise.pm:367) v:*,&,$ ->g |
77 | # - <@> lineseq K ->- |
78 | # g <;> nextstate(B::Concise -265 Concise.pm:367) :*,&,$ ->h |
79 | # l <1> entersub[t1] KS*/TARG,2 ->m |
80 | # h <0> pushmark s ->i |
81 | # i <$> const[PV "strict"] sM ->j |
82 | # j <$> const[PV "refs"] sM ->k |
83 | # k <$> method_named[PV "unimport"] ->l |
84 | # BEGIN 3: |
85 | # x <1> leavesub[1 ref] K/REFC,1 ->(end) |
86 | # - <@> lineseq KP ->x |
87 | # n <;> nextstate(B::Concise -254 Concise.pm:386) v:*,&,{,$ ->o |
88 | # p <1> require sK/1 ->q |
89 | # o <$> const[PV "warnings.pm"] s/BARE ->p |
90 | # q <;> nextstate(B::Concise -254 Concise.pm:386) v:*,&,{,$ ->r |
91 | # - <@> lineseq K ->- |
92 | # r <;> nextstate(B::Concise -254 Concise.pm:386) :*,&,{,$ ->s |
93 | # w <1> entersub[t1] KS*/TARG,2 ->x |
94 | # s <0> pushmark s ->t |
95 | # t <$> const[PV "warnings"] sM ->u |
96 | # u <$> const[PV "qw"] sM ->v |
97 | # v <$> method_named[PV "unimport"] ->w |
98 | # BEGIN 4: |
99 | # 11 <1> leavesub[1 ref] K/REFC,1 ->(end) |
100 | # - <@> lineseq KP ->11 |
c954b578 |
101 | # y <;> nextstate(main 2 -e:1) v:>,<,%,{ ->z |
9e0f9750 |
102 | # 10 <1> postinc[t3] sK/1 ->11 |
103 | # - <1> ex-rv2sv sKRM/1 ->10 |
104 | # z <#> gvsv[*beg] s ->10 |
cc02ea56 |
105 | EOT_EOT |
106 | # BEGIN 1: |
107 | # b <1> leavesub[1 ref] K/REFC,1 ->(end) |
108 | # - <@> lineseq KP ->b |
9e0f9750 |
109 | # 1 <;> nextstate(B::Concise -275 Concise.pm:356) v:*,&,{,$ ->2 |
cc02ea56 |
110 | # 3 <1> require sK/1 ->4 |
9e0f9750 |
111 | # 2 <$> const(PV "strict.pm") s/BARE ->3 |
112 | # 4 <;> nextstate(B::Concise -275 Concise.pm:356) v:*,&,{,$ ->5 |
cc02ea56 |
113 | # - <@> lineseq K ->- |
9e0f9750 |
114 | # 5 <;> nextstate(B::Concise -275 Concise.pm:356) :*,&,{,$ ->6 |
cc02ea56 |
115 | # a <1> entersub[t1] KS*/TARG,2 ->b |
116 | # 6 <0> pushmark s ->7 |
9e0f9750 |
117 | # 7 <$> const(PV "strict") sM ->8 |
118 | # 8 <$> const(PV "refs") sM ->9 |
119 | # 9 <$> method_named(PV "unimport") ->a |
cc02ea56 |
120 | # BEGIN 2: |
9e0f9750 |
121 | # m <1> leavesub[1 ref] K/REFC,1 ->(end) |
122 | # - <@> lineseq K ->m |
123 | # c <;> nextstate(B::Concise -265 Concise.pm:367) v:*,&,$ ->d |
124 | # e <1> require sK/1 ->f |
125 | # d <$> const(PV "strict.pm") s/BARE ->e |
126 | # f <;> nextstate(B::Concise -265 Concise.pm:367) v:*,&,$ ->g |
127 | # - <@> lineseq K ->- |
128 | # g <;> nextstate(B::Concise -265 Concise.pm:367) :*,&,$ ->h |
129 | # l <1> entersub[t1] KS*/TARG,2 ->m |
130 | # h <0> pushmark s ->i |
131 | # i <$> const(PV "strict") sM ->j |
132 | # j <$> const(PV "refs") sM ->k |
133 | # k <$> method_named(PV "unimport") ->l |
134 | # BEGIN 3: |
135 | # x <1> leavesub[1 ref] K/REFC,1 ->(end) |
136 | # - <@> lineseq KP ->x |
137 | # n <;> nextstate(B::Concise -254 Concise.pm:386) v:*,&,{,$ ->o |
138 | # p <1> require sK/1 ->q |
139 | # o <$> const(PV "warnings.pm") s/BARE ->p |
140 | # q <;> nextstate(B::Concise -254 Concise.pm:386) v:*,&,{,$ ->r |
141 | # - <@> lineseq K ->- |
142 | # r <;> nextstate(B::Concise -254 Concise.pm:386) :*,&,{,$ ->s |
143 | # w <1> entersub[t1] KS*/TARG,2 ->x |
144 | # s <0> pushmark s ->t |
145 | # t <$> const(PV "warnings") sM ->u |
146 | # u <$> const(PV "qw") sM ->v |
147 | # v <$> method_named(PV "unimport") ->w |
148 | # BEGIN 4: |
149 | # 11 <1> leavesub[1 ref] K/REFC,1 ->(end) |
150 | # - <@> lineseq KP ->11 |
c954b578 |
151 | # y <;> nextstate(main 2 -e:1) v:>,<,%,{ ->z |
9e0f9750 |
152 | # 10 <1> postinc[t2] sK/1 ->11 |
153 | # - <1> ex-rv2sv sKRM/1 ->10 |
154 | # z <$> gvsv(*beg) s ->10 |
cc02ea56 |
155 | EONT_EONT |
156 | |
157 | |
158 | checkOptree ( name => 'END', |
159 | bcopts => 'END', |
160 | prog => $src, |
be2b1c74 |
161 | strip_open_hints => 1, |
cc02ea56 |
162 | expect => <<'EOT_EOT', expect_nt => <<'EONT_EONT'); |
163 | # END 1: |
164 | # 4 <1> leavesub[1 ref] K/REFC,1 ->(end) |
165 | # - <@> lineseq KP ->4 |
c954b578 |
166 | # 1 <;> nextstate(main 5 -e:6) v:>,<,%,{ ->2 |
cc02ea56 |
167 | # 3 <1> postinc[t3] sK/1 ->4 |
168 | # - <1> ex-rv2sv sKRM/1 ->3 |
169 | # 2 <#> gvsv[*end] s ->3 |
170 | EOT_EOT |
171 | # END 1: |
172 | # 4 <1> leavesub[1 ref] K/REFC,1 ->(end) |
173 | # - <@> lineseq KP ->4 |
c954b578 |
174 | # 1 <;> nextstate(main 5 -e:6) v:>,<,%,{ ->2 |
cc02ea56 |
175 | # 3 <1> postinc[t2] sK/1 ->4 |
176 | # - <1> ex-rv2sv sKRM/1 ->3 |
177 | # 2 <$> gvsv(*end) s ->3 |
178 | EONT_EONT |
179 | |
180 | |
181 | checkOptree ( name => 'CHECK', |
182 | bcopts => 'CHECK', |
183 | prog => $src, |
be2b1c74 |
184 | strip_open_hints => 1, |
cc02ea56 |
185 | expect => <<'EOT_EOT', expect_nt => <<'EONT_EONT'); |
186 | # CHECK 1: |
187 | # 4 <1> leavesub[1 ref] K/REFC,1 ->(end) |
188 | # - <@> lineseq KP ->4 |
c954b578 |
189 | # 1 <;> nextstate(main 3 -e:4) v:>,<,%,{ ->2 |
cc02ea56 |
190 | # 3 <1> postinc[t3] sK/1 ->4 |
191 | # - <1> ex-rv2sv sKRM/1 ->3 |
192 | # 2 <#> gvsv[*chk] s ->3 |
193 | EOT_EOT |
194 | # CHECK 1: |
195 | # 4 <1> leavesub[1 ref] K/REFC,1 ->(end) |
196 | # - <@> lineseq KP ->4 |
c954b578 |
197 | # 1 <;> nextstate(main 3 -e:4) v:>,<,%,{ ->2 |
cc02ea56 |
198 | # 3 <1> postinc[t2] sK/1 ->4 |
199 | # - <1> ex-rv2sv sKRM/1 ->3 |
200 | # 2 <$> gvsv(*chk) s ->3 |
201 | EONT_EONT |
202 | |
e412117e |
203 | if ($] >= 5.009) { |
204 | checkOptree ( name => 'UNITCHECK', |
205 | bcopts=> 'UNITCHECK', |
206 | prog => $src, |
207 | strip_open_hints => 1, |
208 | expect=> <<'EOT_EOT', expect_nt => <<'EONT_EONT'); |
676456c2 |
209 | # UNITCHECK 1: |
210 | # 4 <1> leavesub[1 ref] K/REFC,1 ->(end) |
211 | # - <@> lineseq KP ->4 |
c954b578 |
212 | # 1 <;> nextstate(main 3 -e:4) v:>,<,%,{ ->2 |
676456c2 |
213 | # 3 <1> postinc[t3] sK/1 ->4 |
214 | # - <1> ex-rv2sv sKRM/1 ->3 |
215 | # 2 <#> gvsv[*uc] s ->3 |
216 | EOT_EOT |
217 | # UNITCHECK 1: |
218 | # 4 <1> leavesub[1 ref] K/REFC,1 ->(end) |
219 | # - <@> lineseq KP ->4 |
c954b578 |
220 | # 1 <;> nextstate(main 3 -e:4) v:>,<,%,{ ->2 |
676456c2 |
221 | # 3 <1> postinc[t2] sK/1 ->4 |
222 | # - <1> ex-rv2sv sKRM/1 ->3 |
223 | # 2 <$> gvsv(*uc) s ->3 |
224 | EONT_EONT |
e412117e |
225 | } |
cc02ea56 |
226 | |
227 | checkOptree ( name => 'INIT', |
228 | bcopts => 'INIT', |
229 | #todo => 'get working', |
230 | prog => $src, |
be2b1c74 |
231 | strip_open_hints => 1, |
cc02ea56 |
232 | expect => <<'EOT_EOT', expect_nt => <<'EONT_EONT'); |
233 | # INIT 1: |
234 | # 4 <1> leavesub[1 ref] K/REFC,1 ->(end) |
235 | # - <@> lineseq KP ->4 |
c954b578 |
236 | # 1 <;> nextstate(main 4 -e:5) v:>,<,%,{ ->2 |
cc02ea56 |
237 | # 3 <1> postinc[t3] sK/1 ->4 |
238 | # - <1> ex-rv2sv sKRM/1 ->3 |
239 | # 2 <#> gvsv[*init] s ->3 |
240 | EOT_EOT |
241 | # INIT 1: |
242 | # 4 <1> leavesub[1 ref] K/REFC,1 ->(end) |
243 | # - <@> lineseq KP ->4 |
c954b578 |
244 | # 1 <;> nextstate(main 4 -e:5) v:>,<,%,{ ->2 |
cc02ea56 |
245 | # 3 <1> postinc[t2] sK/1 ->4 |
246 | # - <1> ex-rv2sv sKRM/1 ->3 |
247 | # 2 <$> gvsv(*init) s ->3 |
248 | EONT_EONT |
249 | |
250 | |
676456c2 |
251 | checkOptree ( name => 'all of BEGIN END INIT CHECK UNITCHECK -exec', |
252 | bcopts => [qw/ BEGIN END INIT CHECK UNITCHECK -exec /], |
cc02ea56 |
253 | prog => $src, |
b8443148 |
254 | @warnings_todo, |
be2b1c74 |
255 | strip_open_hints => 1, |
cc02ea56 |
256 | expect => <<'EOT_EOT', expect_nt => <<'EONT_EONT'); |
257 | # BEGIN 1: |
9e0f9750 |
258 | # 1 <;> nextstate(B::Concise -275 Concise.pm:356) v:*,&,{,$ |
259 | # 2 <$> const[PV "strict.pm"] s/BARE |
cc02ea56 |
260 | # 3 <1> require sK/1 |
9e0f9750 |
261 | # 4 <;> nextstate(B::Concise -275 Concise.pm:356) v:*,&,{,$ |
262 | # 5 <;> nextstate(B::Concise -275 Concise.pm:356) :*,&,{,$ |
cc02ea56 |
263 | # 6 <0> pushmark s |
9e0f9750 |
264 | # 7 <$> const[PV "strict"] sM |
265 | # 8 <$> const[PV "refs"] sM |
427d62a4 |
266 | # 9 <$> method_named[PV "unimport"] |
cc02ea56 |
267 | # a <1> entersub[t1] KS*/TARG,2 |
268 | # b <1> leavesub[1 ref] K/REFC,1 |
269 | # BEGIN 2: |
9e0f9750 |
270 | # c <;> nextstate(B::Concise -265 Concise.pm:367) v:*,&,$ |
271 | # d <$> const[PV "strict.pm"] s/BARE |
272 | # e <1> require sK/1 |
273 | # f <;> nextstate(B::Concise -265 Concise.pm:367) v:*,&,$ |
274 | # g <;> nextstate(B::Concise -265 Concise.pm:367) :*,&,$ |
275 | # h <0> pushmark s |
276 | # i <$> const[PV "strict"] sM |
277 | # j <$> const[PV "refs"] sM |
278 | # k <$> method_named[PV "unimport"] |
279 | # l <1> entersub[t1] KS*/TARG,2 |
280 | # m <1> leavesub[1 ref] K/REFC,1 |
281 | # BEGIN 3: |
282 | # n <;> nextstate(B::Concise -254 Concise.pm:386) v:*,&,{,$ |
283 | # o <$> const[PV "warnings.pm"] s/BARE |
284 | # p <1> require sK/1 |
285 | # q <;> nextstate(B::Concise -254 Concise.pm:386) v:*,&,{,$ |
286 | # r <;> nextstate(B::Concise -254 Concise.pm:386) :*,&,{,$ |
287 | # s <0> pushmark s |
288 | # t <$> const[PV "warnings"] sM |
289 | # u <$> const[PV "qw"] sM |
290 | # v <$> method_named[PV "unimport"] |
291 | # w <1> entersub[t1] KS*/TARG,2 |
292 | # x <1> leavesub[1 ref] K/REFC,1 |
293 | # BEGIN 4: |
c954b578 |
294 | # y <;> nextstate(main 2 -e:1) v:>,<,%,{ |
9e0f9750 |
295 | # z <#> gvsv[*beg] s |
296 | # 10 <1> postinc[t3] sK/1 |
297 | # 11 <1> leavesub[1 ref] K/REFC,1 |
cc02ea56 |
298 | # END 1: |
c954b578 |
299 | # 12 <;> nextstate(main 5 -e:1) v:>,<,%,{ |
9e0f9750 |
300 | # 13 <#> gvsv[*end] s |
301 | # 14 <1> postinc[t3] sK/1 |
302 | # 15 <1> leavesub[1 ref] K/REFC,1 |
cc02ea56 |
303 | # INIT 1: |
c954b578 |
304 | # 16 <;> nextstate(main 4 -e:1) v:>,<,%,{ |
9e0f9750 |
305 | # 17 <#> gvsv[*init] s |
306 | # 18 <1> postinc[t3] sK/1 |
307 | # 19 <1> leavesub[1 ref] K/REFC,1 |
cc02ea56 |
308 | # CHECK 1: |
c954b578 |
309 | # 1a <;> nextstate(main 3 -e:1) v:>,<,%,{ |
9e0f9750 |
310 | # 1b <#> gvsv[*chk] s |
311 | # 1c <1> postinc[t3] sK/1 |
312 | # 1d <1> leavesub[1 ref] K/REFC,1 |
676456c2 |
313 | # UNITCHECK 1: |
c954b578 |
314 | # 1e <;> nextstate(main 6 -e:1) v:>,<,%,{ |
9e0f9750 |
315 | # 1f <#> gvsv[*uc] s |
316 | # 1g <1> postinc[t3] sK/1 |
317 | # 1h <1> leavesub[1 ref] K/REFC,1 |
cc02ea56 |
318 | EOT_EOT |
319 | # BEGIN 1: |
9e0f9750 |
320 | # 1 <;> nextstate(B::Concise -275 Concise.pm:356) v:*,&,{,$ |
321 | # 2 <$> const(PV "strict.pm") s/BARE |
cc02ea56 |
322 | # 3 <1> require sK/1 |
9e0f9750 |
323 | # 4 <;> nextstate(B::Concise -275 Concise.pm:356) v:*,&,{,$ |
324 | # 5 <;> nextstate(B::Concise -275 Concise.pm:356) :*,&,{,$ |
cc02ea56 |
325 | # 6 <0> pushmark s |
9e0f9750 |
326 | # 7 <$> const(PV "strict") sM |
327 | # 8 <$> const(PV "refs") sM |
427d62a4 |
328 | # 9 <$> method_named(PV "unimport") |
cc02ea56 |
329 | # a <1> entersub[t1] KS*/TARG,2 |
330 | # b <1> leavesub[1 ref] K/REFC,1 |
331 | # BEGIN 2: |
9e0f9750 |
332 | # c <;> nextstate(B::Concise -265 Concise.pm:367) v:*,&,$ |
333 | # d <$> const(PV "strict.pm") s/BARE |
334 | # e <1> require sK/1 |
335 | # f <;> nextstate(B::Concise -265 Concise.pm:367) v:*,&,$ |
336 | # g <;> nextstate(B::Concise -265 Concise.pm:367) :*,&,$ |
337 | # h <0> pushmark s |
338 | # i <$> const(PV "strict") sM |
339 | # j <$> const(PV "refs") sM |
340 | # k <$> method_named(PV "unimport") |
341 | # l <1> entersub[t1] KS*/TARG,2 |
342 | # m <1> leavesub[1 ref] K/REFC,1 |
343 | # BEGIN 3: |
344 | # n <;> nextstate(B::Concise -254 Concise.pm:386) v:*,&,{,$ |
345 | # o <$> const(PV "warnings.pm") s/BARE |
346 | # p <1> require sK/1 |
347 | # q <;> nextstate(B::Concise -254 Concise.pm:386) v:*,&,{,$ |
348 | # r <;> nextstate(B::Concise -254 Concise.pm:386) :*,&,{,$ |
349 | # s <0> pushmark s |
350 | # t <$> const(PV "warnings") sM |
351 | # u <$> const(PV "qw") sM |
352 | # v <$> method_named(PV "unimport") |
353 | # w <1> entersub[t1] KS*/TARG,2 |
354 | # x <1> leavesub[1 ref] K/REFC,1 |
355 | # BEGIN 4: |
c954b578 |
356 | # y <;> nextstate(main 2 -e:1) v:>,<,%,{ |
9e0f9750 |
357 | # z <$> gvsv(*beg) s |
358 | # 10 <1> postinc[t2] sK/1 |
359 | # 11 <1> leavesub[1 ref] K/REFC,1 |
cc02ea56 |
360 | # END 1: |
c954b578 |
361 | # 12 <;> nextstate(main 5 -e:1) v:>,<,%,{ |
9e0f9750 |
362 | # 13 <$> gvsv(*end) s |
363 | # 14 <1> postinc[t2] sK/1 |
364 | # 15 <1> leavesub[1 ref] K/REFC,1 |
cc02ea56 |
365 | # INIT 1: |
c954b578 |
366 | # 16 <;> nextstate(main 4 -e:1) v:>,<,%,{ |
9e0f9750 |
367 | # 17 <$> gvsv(*init) s |
368 | # 18 <1> postinc[t2] sK/1 |
369 | # 19 <1> leavesub[1 ref] K/REFC,1 |
cc02ea56 |
370 | # CHECK 1: |
c954b578 |
371 | # 1a <;> nextstate(main 3 -e:1) v:>,<,%,{ |
9e0f9750 |
372 | # 1b <$> gvsv(*chk) s |
373 | # 1c <1> postinc[t2] sK/1 |
374 | # 1d <1> leavesub[1 ref] K/REFC,1 |
676456c2 |
375 | # UNITCHECK 1: |
c954b578 |
376 | # 1e <;> nextstate(main 6 -e:1) v:>,<,%,{ |
9e0f9750 |
377 | # 1f <$> gvsv(*uc) s |
378 | # 1g <1> postinc[t2] sK/1 |
379 | # 1h <1> leavesub[1 ref] K/REFC,1 |
cc02ea56 |
380 | EONT_EONT |
2c394315 |
381 | |
382 | |
383 | # perl "-I../lib" -MO=Concise,BEGIN,CHECK,INIT,END,-exec -e '$a=$b && print q/foo/' |
384 | |
385 | |
386 | |
387 | checkOptree ( name => 'regression test for patch 25352', |
388 | bcopts => [qw/ BEGIN END INIT CHECK -exec /], |
389 | prog => 'print q/foo/', |
390 | @warnings_todo, |
391 | expect => <<'EOT_EOT', expect_nt => <<'EONT_EONT'); |
392 | # BEGIN 1: |
9e0f9750 |
393 | # 1 <;> nextstate(B::Concise -275 Concise.pm:356) v:*,&,{,$ |
394 | # 2 <$> const[PV "strict.pm"] s/BARE |
2c394315 |
395 | # 3 <1> require sK/1 |
9e0f9750 |
396 | # 4 <;> nextstate(B::Concise -275 Concise.pm:356) v:*,&,{,$ |
397 | # 5 <;> nextstate(B::Concise -275 Concise.pm:356) :*,&,{,$ |
2c394315 |
398 | # 6 <0> pushmark s |
9e0f9750 |
399 | # 7 <$> const[PV "strict"] sM |
400 | # 8 <$> const[PV "refs"] sM |
2c394315 |
401 | # 9 <$> method_named[PV "unimport"] |
402 | # a <1> entersub[t1] KS*/TARG,2 |
403 | # b <1> leavesub[1 ref] K/REFC,1 |
9e0f9750 |
404 | # BEGIN 2: |
405 | # c <;> nextstate(B::Concise -265 Concise.pm:367) v:*,&,$ |
406 | # d <$> const[PV "strict.pm"] s/BARE |
407 | # e <1> require sK/1 |
408 | # f <;> nextstate(B::Concise -265 Concise.pm:367) v:*,&,$ |
409 | # g <;> nextstate(B::Concise -265 Concise.pm:367) :*,&,$ |
410 | # h <0> pushmark s |
411 | # i <$> const[PV "strict"] sM |
412 | # j <$> const[PV "refs"] sM |
413 | # k <$> method_named[PV "unimport"] |
414 | # l <1> entersub[t1] KS*/TARG,2 |
415 | # m <1> leavesub[1 ref] K/REFC,1 |
416 | # BEGIN 3: |
417 | # n <;> nextstate(B::Concise -254 Concise.pm:386) v:*,&,{,$ |
418 | # o <$> const[PV "warnings.pm"] s/BARE |
419 | # p <1> require sK/1 |
420 | # q <;> nextstate(B::Concise -254 Concise.pm:386) v:*,&,{,$ |
421 | # r <;> nextstate(B::Concise -254 Concise.pm:386) :*,&,{,$ |
422 | # s <0> pushmark s |
423 | # t <$> const[PV "warnings"] sM |
424 | # u <$> const[PV "qw"] sM |
425 | # v <$> method_named[PV "unimport"] |
426 | # w <1> entersub[t1] KS*/TARG,2 |
427 | # x <1> leavesub[1 ref] K/REFC,1 |
2c394315 |
428 | EOT_EOT |
429 | # BEGIN 1: |
9e0f9750 |
430 | # 1 <;> nextstate(B::Concise -275 Concise.pm:356) v:*,&,{,$ |
431 | # 2 <$> const(PV "strict.pm") s/BARE |
2c394315 |
432 | # 3 <1> require sK/1 |
9e0f9750 |
433 | # 4 <;> nextstate(B::Concise -275 Concise.pm:356) v:*,&,{,$ |
434 | # 5 <;> nextstate(B::Concise -275 Concise.pm:356) :*,&,{,$ |
2c394315 |
435 | # 6 <0> pushmark s |
9e0f9750 |
436 | # 7 <$> const(PV "strict") sM |
437 | # 8 <$> const(PV "refs") sM |
2c394315 |
438 | # 9 <$> method_named(PV "unimport") |
439 | # a <1> entersub[t1] KS*/TARG,2 |
440 | # b <1> leavesub[1 ref] K/REFC,1 |
9e0f9750 |
441 | # BEGIN 2: |
442 | # c <;> nextstate(B::Concise -265 Concise.pm:367) v:*,&,$ |
443 | # d <$> const(PV "strict.pm") s/BARE |
444 | # e <1> require sK/1 |
445 | # f <;> nextstate(B::Concise -265 Concise.pm:367) v:*,&,$ |
446 | # g <;> nextstate(B::Concise -265 Concise.pm:367) :*,&,$ |
447 | # h <0> pushmark s |
448 | # i <$> const(PV "strict") sM |
449 | # j <$> const(PV "refs") sM |
450 | # k <$> method_named(PV "unimport") |
451 | # l <1> entersub[t1] KS*/TARG,2 |
452 | # m <1> leavesub[1 ref] K/REFC,1 |
453 | # BEGIN 3: |
454 | # n <;> nextstate(B::Concise -254 Concise.pm:386) v:*,&,{,$ |
455 | # o <$> const(PV "warnings.pm") s/BARE |
456 | # p <1> require sK/1 |
457 | # q <;> nextstate(B::Concise -254 Concise.pm:386) v:*,&,{,$ |
458 | # r <;> nextstate(B::Concise -254 Concise.pm:386) :*,&,{,$ |
459 | # s <0> pushmark s |
460 | # t <$> const(PV "warnings") sM |
461 | # u <$> const(PV "qw") sM |
462 | # v <$> method_named(PV "unimport") |
463 | # w <1> entersub[t1] KS*/TARG,2 |
464 | # x <1> leavesub[1 ref] K/REFC,1 |
2c394315 |
465 | EONT_EONT |