issue47.t 547 B

1234567891011121314151617181920212223242526
  1. #! /usr/bin/env perl
  2. # http://code.google.com/p/perl-compiler/issues/detail?id=47
  3. # B::CC gets lost of anonymous function using "while" and "return"
  4. use Test::More tests => 1;
  5. use strict;
  6. BEGIN {
  7. unshift @INC, 't';
  8. require TestBC;
  9. }
  10. my $script = <<'EOF';
  11. my $f = sub {
  12. while (1) {
  13. return (1);
  14. }
  15. };
  16. print $f->(), "\n";
  17. EOF
  18. use B::CC;
  19. TODO: {
  20. local $TODO = "broken with 5.24" if $] > 5.023007;
  21. ctest(1, '^1$', "CC", "ccode47i", $script,
  22. ($B::CC::VERSION < 1.08 ? "TODO ":"")."CC anonsub in while fixed with r618");
  23. }