issue39.t 486 B

123456789101112131415161718192021222324
  1. #! /usr/bin/env perl
  2. # http://code.google.com/p/perl-compiler/issues/detail?id=39
  3. # B::CC generated code aborts with "Bizarre copy of ARRAY in leavesub"
  4. use Test::More tests => 1;
  5. use strict;
  6. BEGIN {
  7. unshift @INC, 't';
  8. require "test.pl";
  9. }
  10. my $script = <<'EOF';
  11. sub f1 { 0 }
  12. sub f2 {
  13. my $x;
  14. if ( f1() ) {}
  15. if ($x) {} else { [$x] }
  16. }
  17. my @a = f2();
  18. print "ok";
  19. EOF
  20. ctestok(1, "CC", "ccode39i", $script,
  21. "CC Bizarre copy of ARRAY in leavesub fixed with r596");