STRLEN != int.
[p5sagit/p5-mst-13.2.git] / t / run / kill_perl.t
CommitLineData
a0d0e21e 1#!./perl
2
c9beb3f5 3# This is for tests that will normally cause segfaults, and other nasty
4# errors that might kill the interpreter and for some reason you can't
5# use an eval().
6#
7# New tests are added to the bottom. For example.
8#
9# ######## perlbug ID 20020831.001
10# ($a, b) = (1,2)
11# EXPECT
12# Can't modify constant item in list assignment - at line 1
13#
14# to test that the code "($a, b) = (1,2)" causes the appropriate syntax
15# error, rather than just segfaulting as reported in perlbug ID
16# 20020831.001
17#
18#
19# NOTE: Please don't add tests to this file unless they *need* to be
20# run in separate executable and can't simply use eval.
fb73857a 21
c9beb3f5 22BEGIN {
23 chdir 't' if -d 't';
24 @INC = '../lib';
25}
26
27use strict;
a0d0e21e 28
29$|=1;
30
c9beb3f5 31my @prgs = ();
32while(<DATA>) {
33 if(m/^#{8,}\s*(.*)/) {
34 push @prgs, ['', $1];
35 }
36 else {
37 $prgs[-1][0] .= $_;
38 }
39}
a0d0e21e 40print "1..", scalar @prgs, "\n";
41
c9beb3f5 42my $tmpfile = "misctmp000";
a0d0e21e 431 while -f ++$tmpfile;
ed6b3797 44END { while($tmpfile && unlink $tmpfile){} }
a0d0e21e 45
c9beb3f5 46my $test = 1;
47foreach my $prog (@prgs) {
48 my($raw_prog, $name) = @$prog;
68dc0745 49
a0d0e21e 50 my $switch;
c9beb3f5 51 if ($raw_prog =~ s/^\s*(-\w.*)//){
fb73857a 52 $switch = $1;
a0d0e21e 53 }
c9beb3f5 54
55 my($prog,$expected) = split(/\nEXPECT\n/, $raw_prog);
56
648cac19 57 open TEST, ">$tmpfile" or die "Cannot open $tmpfile: $!";
c9beb3f5 58
59 # VMS adjustments
60 if( $^O eq 'VMS' ) {
61 $prog =~ s#/dev/null#NL:#;
62
63 # VMS file locking
64 $prog =~ s{if \(-e _ and -f _ and -r _\)}
65 {if (-e _ and -f _)}
66 }
ed6b3797 67
648cac19 68 print TEST $prog, "\n";
69 close TEST or die "Cannot close $tmpfile: $!";
70
c9beb3f5 71 my $results;
68dc0745 72 if ($^O eq 'MSWin32') {
c9beb3f5 73 $results = `.\\perl -I../lib $switch $tmpfile 2>&1`;
68dc0745 74 }
c9beb3f5 75 elsif ($^O eq 'NetWare') {
76 $results = `perl -I../lib $switch $tmpfile 2>&1`;
2986a63f 77 }
be708cc0 78 elsif ($^O eq 'MacOS') {
79 $results = `$^X -I::lib -MMac::err=unix $switch $tmpfile`;
80 }
68dc0745 81 else {
11ee3f28 82 $results = `./perl "-I../lib" $switch $tmpfile 2>&1`;
68dc0745 83 }
c9beb3f5 84 my $status = $?;
85
86 # Clean up the results into something a bit more predictable.
a0d0e21e 87 $results =~ s/\n+$//;
648cac19 88 $results =~ s/at\s+misctmp\d+\s+line/at - line/g;
89 $results =~ s/of\s+misctmp\d+\s+aborted/of - aborted/g;
c9beb3f5 90
91 # bison says 'parse error' instead of 'syntax error',
92 # various yaccs may or may not capitalize 'syntax'.
2a8ee232 93 $results =~ s/^(syntax|parse) error/syntax error/mig;
c9beb3f5 94
765ebaf2 95 if ($^O eq 'VMS') {
96 # some tests will trigger VMS messages that won't be expected
97 $results =~ s/\n?%[A-Z]+-[SIWEF]-[A-Z]+,.*//;
98
99 # pipes double these sometimes
100 $results =~ s/\n\n/\n/g;
101 }
c9beb3f5 102
a0d0e21e 103 $expected =~ s/\n+$//;
c9beb3f5 104 my $ok = $results eq $expected;
105
106 unless( $ok ) {
107 print STDERR "# PROG: $switch\n$prog\n";
108 print STDERR "# EXPECTED:\n$expected\n";
109 print STDERR "# GOT:\n$results\n";
a0d0e21e 110 }
c9beb3f5 111 printf "%sok %d%s\n", ($ok ? '' : "not "), $test,
112 length $name ? " - $name" : $name;
113 $test++;
a0d0e21e 114}
115
116__END__
2ace3117 117########
44a8e56a 118$a = ":="; split /($a)/o, "a:=b:=c"; print "@_"
119EXPECT
120a := b := c
121########
36477c24 122$cusp = ~0 ^ (~0 >> 1);
85e0ebd8 123use integer;
36477c24 124$, = " ";
85e0ebd8 125print +($cusp - 1) % 8, $cusp % 8, -$cusp % 8, 8 | (($cusp + 1) % 8 + 7), "!\n";
36477c24 126EXPECT
85e0ebd8 1277 0 0 8 !
36477c24 128########
a0d0e21e 129$foo=undef; $foo->go;
130EXPECT
72b5445b 131Can't call method "go" on an undefined value at - line 1.
a0d0e21e 132########
133BEGIN
134 {
135 "foo";
136 }
137########
a0d0e21e 138$array[128]=1
139########
140$x=0x0eabcd; print $x->ref;
141EXPECT
142Can't call method "ref" without a package or object reference at - line 1.
143########
648cac19 144chop ($str .= <DATA>);
a0d0e21e 145########
146close ($banana);
147########
148$x=2;$y=3;$x<$y ? $x : $y += 23;print $x;
149EXPECT
15025
151########
152eval {sub bar {print "In bar";}}
153########
68dc0745 154system './perl -ne "print if eof" /dev/null'
a0d0e21e 155########
648cac19 156chop($file = <DATA>);
a0d0e21e 157########
158package N;
159sub new {my ($obj,$n)=@_; bless \$n}
160$aa=new N 1;
161$aa=12345;
162print $aa;
163EXPECT
16412345
165########
166%@x=0;
167EXPECT
f1612b5c 168Can't modify hash dereference in repeat (x) at - line 1, near "0;"
3fe9a6f1 169Execution of - aborted due to compilation errors.
a0d0e21e 170########
171$_="foo";
172printf(STDOUT "%s\n", $_);
173EXPECT
174foo
175########
176push(@a, 1, 2, 3,)
177########
178quotemeta ""
179########
180for ("ABCDE") {
181 &sub;
182s/./&sub($&)/eg;
183print;}
184sub sub {local($_) = @_;
185$_ x 4;}
186EXPECT
187Modification of a read-only value attempted at - line 3.
188########
189package FOO;sub new {bless {FOO => BAR}};
190package main;
191use strict vars;
192my $self = new FOO;
193print $$self{FOO};
194EXPECT
195BAR
196########
197$_="foo";
198s/.{1}//s;
199print;
200EXPECT
201oo
202########
203print scalar ("foo","bar")
204EXPECT
205bar
206########
207sub by_number { $a <=> $b; };# inline function for sort below
208$as_ary{0}="a0";
209@ordered_array=sort by_number keys(%as_ary);
210########
211sub NewShell
212{
213 local($Host) = @_;
214 my($m2) = $#Shells++;
215 $Shells[$m2]{HOST} = $Host;
216 return $m2;
217}
218
219sub ShowShell
220{
221 local($i) = @_;
222}
223
224&ShowShell(&NewShell(beach,Work,"+0+0"));
225&ShowShell(&NewShell(beach,Work,"+0+0"));
226&ShowShell(&NewShell(beach,Work,"+0+0"));
227########
228 {
229 package FAKEARRAY;
230
231 sub TIEARRAY
232 { print "TIEARRAY @_\n";
233 die "bomb out\n" unless $count ++ ;
234 bless ['foo']
235 }
236 sub FETCH { print "fetch @_\n"; $_[0]->[$_[1]] }
237 sub STORE { print "store @_\n"; $_[0]->[$_[1]] = $_[2] }
238 sub DESTROY { print "DESTROY \n"; undef @{$_[0]}; }
239 }
240
241eval 'tie @h, FAKEARRAY, fred' ;
242tie @h, FAKEARRAY, fred ;
243EXPECT
244TIEARRAY FAKEARRAY fred
245TIEARRAY FAKEARRAY fred
246DESTROY
247########
248BEGIN { die "phooey\n" }
249EXPECT
250phooey
251BEGIN failed--compilation aborted at - line 1.
252########
253BEGIN { 1/$zero }
254EXPECT
255Illegal division by zero at - line 1.
256BEGIN failed--compilation aborted at - line 1.
257########
258BEGIN { undef = 0 }
259EXPECT
260Modification of a read-only value attempted at - line 1.
261BEGIN failed--compilation aborted at - line 1.
a7adf1f0 262########
263{
264 package foo;
265 sub PRINT {
266 shift;
267 print join(' ', reverse @_)."\n";
268 }
46fc3d4c 269 sub PRINTF {
270 shift;
271 my $fmt = shift;
272 print sprintf($fmt, @_)."\n";
273 }
a7adf1f0 274 sub TIEHANDLE {
275 bless {}, shift;
276 }
58f51617 277 sub READLINE {
278 "Out of inspiration";
279 }
a7adf1f0 280 sub DESTROY {
281 print "and destroyed as well\n";
2ae324a7 282 }
283 sub READ {
284 shift;
285 print STDOUT "foo->can(READ)(@_)\n";
286 return 100;
287 }
288 sub GETC {
289 shift;
290 print STDOUT "Don't GETC, Get Perl\n";
291 return "a";
292 }
a7adf1f0 293}
294{
295 local(*FOO);
296 tie(*FOO,'foo');
297 print FOO "sentence.", "reversed", "a", "is", "This";
58f51617 298 print "-- ", <FOO>, " --\n";
2ae324a7 299 my($buf,$len,$offset);
300 $buf = "string";
301 $len = 10; $offset = 1;
302 read(FOO, $buf, $len, $offset) == 100 or die "foo->READ failed";
303 getc(FOO) eq "a" or die "foo->GETC failed";
46fc3d4c 304 printf "%s is number %d\n", "Perl", 1;
a7adf1f0 305}
306EXPECT
307This is a reversed sentence.
58f51617 308-- Out of inspiration --
2ae324a7 309foo->can(READ)(string 10 1)
310Don't GETC, Get Perl
46fc3d4c 311Perl is number 1
a7adf1f0 312and destroyed as well
a6006777 313########
314my @a; $a[2] = 1; for (@a) { $_ = 2 } print "@a\n"
315EXPECT
3162 2 2
317########
8ff950ac 318# used to attach defelem magic to all immortal values,
8b530633 319# which made restore of local $_ fail.
320foo(2>1);
321sub foo { bar() for @_; }
322sub bar { local $_; }
323print "ok\n";
324EXPECT
325ok
326########
a6006777 327@a = ($a, $b, $c, $d) = (5, 6);
328print "ok\n"
329 if ($a[0] == 5 and $a[1] == 6 and !defined $a[2] and !defined $a[3]);
330EXPECT
331ok
332########
333print "ok\n" if (1E2<<1 == 200 and 3E4<<3 == 240000);
334EXPECT
335ok
336########
8ebc5c01 337print "ok\n" if ("\0" lt "\xFF");
a6006777 338EXPECT
339ok
340########
9731f9ce 341open(H,'run/kill_perl.t'); # must be in the 't' directory
a6006777 342stat(H);
343print "ok\n" if (-e _ and -f _ and -r _);
344EXPECT
345ok
346########
347sub thing { 0 || return qw(now is the time) }
348print thing(), "\n";
349EXPECT
350nowisthetime
351########
352$ren = 'joy';
353$stimpy = 'happy';
354{ local $main::{ren} = *stimpy; print $ren, ' ' }
355print $ren, "\n";
356EXPECT
357happy joy
358########
359$stimpy = 'happy';
360{ local $main::{ren} = *stimpy; print ${'ren'}, ' ' }
361print +(defined(${'ren'}) ? 'oops' : 'joy'), "\n";
362EXPECT
363happy joy
364########
365package p;
366sub func { print 'really ' unless wantarray; 'p' }
367sub groovy { 'groovy' }
368package main;
369print p::func()->groovy(), "\n"
370EXPECT
371really groovy
372########
d53f8f1c 373@list = ([ 'one', 1 ], [ 'two', 2 ]);
374sub func { $num = shift; (grep $_->[1] == $num, @list)[0] }
375print scalar(map &func($_), 1 .. 3), " ",
376 scalar(map scalar &func($_), 1 .. 3), "\n";
377EXPECT
3782 3
379########
44a8e56a 380($k, $s) = qw(x 0);
381@{$h{$k}} = qw(1 2 4);
382for (@{$h{$k}}) { $s += $_; delete $h{$k} if ($_ == 2) }
383print "bogus\n" unless $s == 7;
384########
385my $a = 'outer';
386eval q[ my $a = 'inner'; eval q[ print "$a " ] ];
387eval { my $x = 'peace'; eval q[ print "$x\n" ] }
388EXPECT
389inner peace
774d564b 390########
391-w
392$| = 1;
393sub foo {
394 print "In foo1\n";
395 eval 'sub foo { print "In foo2\n" }';
396 print "Exiting foo1\n";
397}
398foo;
399foo;
400EXPECT
401In foo1
402Subroutine foo redefined at (eval 1) line 1.
403Exiting foo1
404In foo2
405########
406$s = 0;
407map {#this newline here tickles the bug
408$s += $_} (1,2,4);
409print "eat flaming death\n" unless ($s == 7);
1ca7b98a 410########
411sub foo { local $_ = shift; split; @_ }
412@x = foo(' x y z ');
413print "you die joe!\n" unless "@x" eq 'x y z';
c277df42 414########
415/(?{"{"})/ # Check it outside of eval too
416EXPECT
2cd61cdb 417Sequence (?{...}) not terminated or not {}-balanced at - line 1, within pattern
7253e4e3 418Sequence (?{...}) not terminated or not {}-balanced in regex; marked by <-- HERE in m/(?{ <-- HERE "{"})/ at - line 1.
c277df42 419########
420/(?{"{"}})/ # Check it outside of eval too
421EXPECT
d98d5fff 422Unmatched right curly bracket at (re_eval 1) line 1, at end of line
c277df42 423syntax error at (re_eval 1) line 1, near ""{"}"
2cd61cdb 424Compilation failed in regexp at - line 1.
0da4822f 425########
ff689196 426BEGIN { @ARGV = qw(a b c d e) }
0da4822f 427BEGIN { print "argv <@ARGV>\nbegin <",shift,">\n" }
428END { print "end <",shift,">\nargv <@ARGV>\n" }
429INIT { print "init <",shift,">\n" }
7d30b5c4 430CHECK { print "check <",shift,">\n" }
0da4822f 431EXPECT
ff689196 432argv <a b c d e>
0da4822f 433begin <a>
7d30b5c4 434check <b>
ff689196 435init <c>
436end <d>
437argv <e>
4599a1de 438########
3500f679 439-l
440# fdopen from a system descriptor to a system descriptor used to close
441# the former.
442open STDERR, '>&=STDOUT' or die $!;
75642110 443select STDOUT; $| = 1; print fileno STDOUT or die $!;
444select STDERR; $| = 1; print fileno STDERR or die $!;
3500f679 445EXPECT
4461
4472
448########
20408e3c 449-w
450sub testme { my $a = "test"; { local $a = "new test"; print $a }}
451EXPECT
452Can't localize lexical variable $a at - line 2.
453########
51ae5c03 454package X;
455sub ascalar { my $r; bless \$r }
456sub DESTROY { print "destroyed\n" };
457package main;
458*s = ascalar X;
459EXPECT
460destroyed
461########
462package X;
463sub anarray { bless [] }
464sub DESTROY { print "destroyed\n" };
465package main;
466*a = anarray X;
467EXPECT
468destroyed
469########
470package X;
471sub ahash { bless {} }
472sub DESTROY { print "destroyed\n" };
473package main;
474*h = ahash X;
475EXPECT
476destroyed
477########
478package X;
479sub aclosure { my $x; bless sub { ++$x } }
480sub DESTROY { print "destroyed\n" };
481package main;
482*c = aclosure X;
483EXPECT
484destroyed
485########
486package X;
487sub any { bless {} }
488my $f = "FH000"; # just to thwart any future optimisations
ded8aa31 489sub afh { select select ++$f; my $r = *{$f}{IO}; delete $X::{$f}; bless $r }
51ae5c03 490sub DESTROY { print "destroyed\n" }
491package main;
492$x = any X; # to bump sv_objcount. IO objs aren't counted??
493*f = afh X;
494EXPECT
495destroyed
496destroyed
497########
ebf99b04 498BEGIN {
499 $| = 1;
500 $SIG{__WARN__} = sub {
501 eval { print $_[0] };
502 die "bar\n";
503 };
504 warn "foo\n";
505}
506EXPECT
507foo
508bar
509BEGIN failed--compilation aborted at - line 8.
8feb4e9f 510########
511package X;
512@ISA='Y';
513sub new {
514 my $class = shift;
515 my $self = { };
516 bless $self, $class;
517 my $init = shift;
518 $self->foo($init);
519 print "new", $init;
520 return $self;
521}
522sub DESTROY {
523 my $self = shift;
524 print "DESTROY", $self->foo;
525}
526package Y;
527sub attribute {
528 my $self = shift;
529 my $var = shift;
530 if (@_ == 0) {
531 return $self->{$var};
532 } elsif (@_ == 1) {
533 $self->{$var} = shift;
534 }
535}
536sub AUTOLOAD {
537 $AUTOLOAD =~ /::([^:]+)$/;
538 my $method = $1;
539 splice @_, 1, 0, $method;
540 goto &attribute;
541}
542package main;
543my $x = X->new(1);
544for (2..3) {
545 my $y = X->new($_);
546 print $y->foo;
547}
548print $x->foo;
549EXPECT
550new1new22DESTROY2new33DESTROY31DESTROY1
dfad63ad 551########
552re();
553sub re {
14455d6c 554 my $re = join '', eval 'qr/(??{ $obj->method })/';
dfad63ad 555 $re;
556}
557EXPECT
1aff0e91 558########
559use strict;
560my $foo = "ZZZ\n";
561END { print $foo }
562EXPECT
563ZZZ
564########
565eval '
566use strict;
567my $foo = "ZZZ\n";
568END { print $foo }
569';
570EXPECT
571ZZZ
7399586d 572########
573-w
574if (@ARGV) { print "" }
575else {
576 if ($x == 0) { print "" } else { print $x }
577}
578EXPECT
b89fed5f 579Use of uninitialized value in numeric eq (==) at - line 4.
1d76a5c3 580########
581$x = sub {};
582foo();
583sub foo { eval { return }; }
584print "ok\n";
585EXPECT
586ok
07447971 587########
b0f2b690 588# moved to op/lc.t
07447971 589EXPECT
92d29cee 590########
591sub f { my $a = 1; my $b = 2; my $c = 3; my $d = 4; next }
592my $x = "foo";
593{ f } continue { print $x, "\n" }
594EXPECT
595foo
6a7129a1 596########
597sub C () { 1 }
598sub M { $_[0] = 2; }
599eval "C";
600M(C);
601EXPECT
602Modification of a read-only value attempted at - line 2.
00c29ff8 603########
604print qw(ab a\b a\\b);
605EXPECT
606aba\ba\b
dd8482fc 607########
c71fccf1 608# lexicals declared after the myeval() definition should not be visible
609# within it
610sub myeval { eval $_[0] }
611my $foo = "ok 2\n";
612myeval('sub foo { local $foo = "ok 1\n"; print $foo; }');
613die $@ if $@;
614foo();
615print $foo;
616EXPECT
617ok 1
618ok 2
619########
2090ab20 620# lexicals outside an eval"" should be visible inside subroutine definitions
621# within it
622eval <<'EOT'; die $@ if $@;
623{
624 my $X = "ok\n";
625 eval 'sub Y { print $X }'; die $@ if $@;
626 Y();
627}
628EOT
629EXPECT
630ok
631########
dd8482fc 632# This test is here instead of pragma/locale.t because
633# the bug depends on in the internal state of the locale
634# settings and pragma/locale messes up that state pretty badly.
635# We need a "fresh run".
c9f931b8 636BEGIN {
637 eval { require POSIX };
638 if ($@) {
639 exit(0); # running minitest?
640 }
641}
dd8482fc 642use Config;
643my $have_setlocale = $Config{d_setlocale} eq 'define';
dd8482fc 644$have_setlocale = 0 if $@;
645# Visual C's CRT goes silly on strings of the form "en_US.ISO8859-1"
646# and mingw32 uses said silly CRT
2986a63f 647$have_setlocale = 0 if (($^O eq 'MSWin32' || $^O eq 'NetWare') && $Config{cc} =~ /^(cl|gcc)/i);
dd8482fc 648exit(0) unless $have_setlocale;
649my @locales;
650if (-x "/usr/bin/locale" && open(LOCALES, "/usr/bin/locale -a|")) {
651 while(<LOCALES>) {
652 chomp;
653 push(@locales, $_);
654 }
655 close(LOCALES);
656}
657exit(0) unless @locales;
658for (@locales) {
659 use POSIX qw(locale_h);
660 use locale;
88e7acd2 661 setlocale(LC_NUMERIC, $_) or next;
dd8482fc 662 my $s = sprintf "%g %g", 3.1, 3.1;
663 next if $s eq '3.1 3.1' || $s =~ /^(3.+1) \1$/;
664 print "$_ $s\n";
665}
666EXPECT
b927783e 667########
668die qr(x)
669EXPECT
670(?-xism:x) at - line 1.
671########
7ef822cd 672# 20001210.003 mjd@plover.com
673format REMITOUT_TOP =
674FOO
675.
676
677format REMITOUT =
678BAR
679.
680
681# This loop causes a segv in 5.6.0
682for $lineno (1..61) {
683 write REMITOUT;
684}
685
686print "It's OK!";
687EXPECT
688It's OK!
cb55de95 689########
690# Inaba Hiroto
691reset;
692if (0) {
693 if ("" =~ //) {
694 }
695}
696########
697# Nicholas Clark
698$ENV{TERM} = 0;
699reset;
700// if 0;
701########
702# Vadim Konovalov
703use strict;
704sub new_pmop($) {
705 my $pm = shift;
706 return eval "sub {shift=~/$pm/}";
707}
708new_pmop "abcdef"; reset;
709new_pmop "abcdef"; reset;
710new_pmop "abcdef"; reset;
711new_pmop "abcdef"; reset;
880649cd 712########
713# David Dyck
714# coredump in 5.7.1
715close STDERR; die;
716EXPECT
dba9804b 717########
99799961 718-w
719"x" =~ /(\G?x)?/; # core dump in 20000716.007
99799961 720########
dba9804b 721# Bug 20010515.004
722my @h = 1 .. 10;
723bad(@h);
724sub bad {
725 undef @h;
726 print "O";
727 print for @_;
728 print "K";
729}
730EXPECT
731OK
97b9a4cb 732########
733# Bug 20010506.041
734"abcd\x{1234}" =~ /(a)(b[c])(d+)?/i and print "ok\n";
735EXPECT
736ok
0b490c9c 737########
738# Bug 20010422.005
739{s//${}/; //}
740EXPECT
2172ddaf 741syntax error at - line 2, near "${}"
0b490c9c 742Execution of - aborted due to compilation errors.
585602fa 743########
744# Bug 20010528.007
745"\x{"
746EXPECT
747Missing right brace on \x{} at - line 2, within string
748Execution of - aborted due to compilation errors.
08b362fd 749########
750my $foo = Bar->new();
751my @dst;
752END {
753 ($_ = "@dst") =~ s/\(0x.+?\)/(0x...)/;
754 print $_, "\n";
755}
756package Bar;
757sub new {
758 my Bar $self = bless [], Bar;
759 eval '$self';
760 return $self;
761}
762sub DESTROY {
763 push @dst, "$_[0]";
764}
765EXPECT
766Bar=ARRAY(0x...)
1f96ff2a 767########
6ee35fb7 768# 20010407.008 sprintf removes utf8-ness
769$a = sprintf "\x{1234}";
770printf "%x %d\n", unpack("U*", $a), length($a);
9efebafb 771$a = sprintf "%s", "\x{5678}";
772printf "%x %d\n", unpack("U*", $a), length($a);
6ee35fb7 773$a = sprintf "\x{1234}%s", "\x{5678}";
774printf "%x %x %d\n", unpack("U*", $a), length($a);
775EXPECT
7761234 1
9efebafb 7775678 1
6ee35fb7 7781234 5678 2
7c8c5f1c 779######## found by Markov chain stress testing
1f96ff2a 780eval "a.b.c.d.e.f;sub"
781EXPECT
c9beb3f5 782
783######## perlbug ID 20010831.001
784($a, b) = (1, 2);
785EXPECT
786Can't modify constant item in list assignment at - line 1, near ");"
787Execution of - aborted due to compilation errors.
f8d0fd74 788######## tying a bareword causes a segfault in 5.6.1
789tie FOO, "Foo";
790EXPECT
791Can't modify constant item in tie at - line 1, near ""Foo";"
792Execution of - aborted due to compilation errors.
abfc75a9 793######## undefing constant causes a segfault in 5.6.1 [ID 20010906.019]
794undef foo;
795EXPECT
796Can't modify constant item in undef operator at - line 1, near "foo;"
797Execution of - aborted due to compilation errors.
8bfdd7d9 798######## (?{...}) compilation bounces on PL_rs
799-0
800{
801 /(?{ $x })/;
802 # {
803}
804BEGIN { print "ok\n" }
805EXPECT
806ok