issue47.t 485 B

1234567891011121314151617181920212223
  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 "test.pl";
  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. ctest(1, '^1$', "CC", "ccode47i", $script,
  20. ($B::CC::VERSION < 1.08 ? "TODO ":"")."CC anonsub in while fixed with r618");