issue52.t 539 B

1234567891011121314151617181920212223
  1. #! /usr/bin/env perl
  2. # http://code.google.com/p/perl-compiler/issues/detail?id=52
  3. # B:CC errors on variable with numeric value used in second expression of 'and'
  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 $x;
  12. my $y = 1;
  13. $x and $y == 2;
  14. print $y == 1 ? "ok\n" : "fail\n";
  15. EOF
  16. use B::CC;
  17. ctestok(1, "CC", "ccode52i", $script,
  18. $B::CC::VERSION < 1.08
  19. ? "TODO B:CC numeric value used in second expression of 'and' - issue52 fixed with r692"
  20. : undef);