+
+# Ought to fail, doesn't in 5.8.1.
+eval 'sub bug (\[%@]) { } my $array = [0 .. 1]; bug %$array;';
+print "not " unless $@ =~ /Not a HASH reference/;
+print "ok ", $i++, "\n";
+
+# [perl #75904]
+# Test that the following prototypes make subs parse as unary functions:
+# * \sigil \[...] ;$ ;* ;\sigil ;\[...]
+# [perl #118585]
+# As a special case, make sure that ;;* is treated the same as ;*
+print "not "
+ unless eval 'sub uniproto1 (*) {} uniproto1 $_, 1' or warn $@;
+print "ok ", $i++, "\n";
+print "not "
+ unless eval 'sub uniproto2 (\$) {} uniproto2 $_, 1' or warn $@;
+print "ok ", $i++, "\n";
+print "not "
+ unless eval 'sub uniproto3 (\[$%]) {} uniproto3 %_, 1' or warn $@;
+print "ok ", $i++, "\n";
+print "not "
+ unless eval 'sub uniproto4 (;$) {} uniproto4 $_, 1' or warn $@;
+print "ok ", $i++, "\n";
+print "not "
+ unless eval 'sub uniproto5 (;*) {} uniproto5 $_, 1' or warn $@;
+print "ok ", $i++, "\n";
+print "not "
+ unless eval 'sub uniproto6 (;\@) {} uniproto6 @_, 1' or warn $@;
+print "ok ", $i++, "\n";
+print "not "
+ unless eval 'sub uniproto7 (;\[$%@]) {} uniproto7 @_, 1' or warn $@;
+print "ok ", $i++, "\n";
+print "not "
+ unless eval 'sub uniproto8 (+) {} uniproto8 $_, 1' or warn $@;
+print "ok ", $i++, "\n";
+print "not "
+ unless eval 'sub uniproto9 (;+) {} uniproto9 $_, 1' or warn $@;
+print "ok ", $i++, "\n";
+print "not "
+ unless eval 'sub uniproto10 (;;;*) {} uniproto10 $_, 1' or warn $@;
+print "ok ", $i++, " - uniproto10 (;;;*)\n";
+print "not "
+ unless eval 'sub uniproto11 ( ; ; ; * ) {} uniproto10 $_, 1' or warn $@;
+print "ok ", $i++, " - uniproto11 ( ; ; ; *)\n";
+print "not "
+ unless eval 'sub uniproto12 (;;;+) {} uniproto12 $_, 1' or warn $@;
+print "ok ", $i++, " - uniproto12 (;;;*)\n";
+print "not "
+ unless eval 'sub uniproto12 ( ; ; ; + ) {} uniproto12 $_, 1' or warn $@;
+print "ok ", $i++, " - uniproto12 ( ; ; ; * )\n";
+
+# Test that a trailing semicolon makes a sub have listop precedence
+sub unilist ($;) { $_[0]+1 }
+sub unilist2(_;) { $_[0]+1 }
+sub unilist3(;$;) { $_[0]+1 }
+print "not " unless (unilist 0 || 5) == 6;
+print "ok ", $i++, "\n";
+print "not " unless (unilist2 0 || 5) == 6;
+print "ok ", $i++, "\n";
+print "not " unless (unilist3 0 || 5) == 6;
+print "ok ", $i++, "\n";
+
+{
+ # Lack of prototype on a subroutine definition should override any prototype
+ # on the declaration.
+ sub z_zwap (&);
+
+ local $SIG{__WARN__} = sub {
+ my $thiswarn = join "",@_;
+ if ($thiswarn =~ /^Prototype mismatch: sub main::z_zwap/) {
+ print 'ok ', $i++, "\n";
+ } else {
+ print 'not ok ', $i++, "\n";
+ print STDERR $thiswarn;
+ }
+ };
+
+ eval q{sub z_zwap {return @_}};
+
+ if ($@) {
+ print "not ok ", $i++, "# $@";
+ } else {
+ print "ok ", $i++, "\n";
+ }
+
+
+ my @a = (6,4,2);
+ my @got = eval q{z_zwap(@a)};
+
+ if ($@) {
+ print "not ok ", $i++, " # $@";
+ } else {
+ print "ok ", $i++, "\n";
+ }
+
+ if ("@got" eq "@a") {
+ print "ok ", $i++, "\n";
+ } else {
+ print "not ok ", $i++, " # >@got<\n";
+ }
+}