This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Add a failing test for stack corruption with MULTICALL
[perl5.git] / ext / List-Util / t / stack-corruption.t
1 #!./perl
2
3 BEGIN {
4     unless (-d 'blib') {
5         chdir 't' if -d 't';
6         @INC = '../lib';
7         require Config; import Config;
8         keys %Config; # Silence warning
9         if ($Config{extensions} !~ /\bList\/Util\b/) {
10             print "1..0 # Skip: List::Util was not built\n";
11             exit 0;
12         }
13     }
14 }
15
16 use List::Util qw(reduce);
17 use Test::More tests => 1;
18
19 my $ret = "original";
20 $ret = $ret . broken();
21 is($ret, "originalreturn");
22
23 sub broken {
24     reduce { return "bogus"; } qw/some thing/;
25     return "return";
26 }