issue51.t 620 B

12345678910111213141516171819202122232425262728
  1. #! /usr/bin/env perl
  2. # http://code.google.com/p/perl-compiler/issues/detail?id=51
  3. # B::CC errors on nested if statement with test on multiple variables
  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 ($p1, $p2) = (80, 80);
  12. if ($p1 <= 23 && 23 <= $p2) {
  13. print "telnet\n";
  14. }
  15. elsif ($p1 <= 80 && 80 <= $p2) {
  16. print "http\n";
  17. }
  18. else {
  19. print "fail\n"
  20. }
  21. EOF
  22. use B::CC;
  23. ctest(1, '^http$', "CC", "ccode51i", $script,
  24. ($B::CC::VERSION < 1.08 ? "TODO " : "")
  25. . "CC nested if on multiple variables - issue51. Fixed with B-C-1.28 r659");